Resident microbes play important roles in the development of the gastrointestinal tract, but their influence on other digestive organs is less well explored. Using the gnotobiotic zebrafish, we discovered that the normal expansion of the pancreatic β cell population during early larval development requires the intestinal microbiota and that specific bacterial members can restore normal β cell numbers. These bacteria share a gene that encodes a previously undescribed protein, named herein BefA (β Cell Expansion Factor A), which is sufficient to induce β cell proliferation in developing zebrafish larvae. Homologs of BefA are present in several human-associated bacterial species, and we show that they have conserved capacity to stimulate β cell proliferation in larval zebrafish. Our findings highlight a role for the microbiota in early pancreatic β cell development and suggest a possible basis for the association between low diversity childhood fecal microbiota and increased diabetes risk.