The minimal standard model of quarks and leptons is extended with a set of vectorlike fermions to allow baryon number B to become a gauged symmetry. The B assignments of the new particles are determined by renormalizable interactions with the known quarks through a color triplet scalar diquark. The spontaneous breaking of by a scalar with results in a conserved residual global B symmetry. A singlet neutral scalar with is a possible long-lived dark-matter candidate.