Caenorhabditis elegans gut granules are intestine specific lysosome-related organelles with birefringent and autofluorescent contents. We identified pgp-2, which encodes an ABC transporter, in screens for genes required for the proper formation of gut granules. pgp-2(-) embryos mislocalize birefringent material into the intestinal lumen and are lacking in acidified intestinal V-ATPase-containing compartments. Adults without pgp-2(+) function similarly lack organelles with gut granule characteristics. These cellular phenotypes indicate that pgp-2(-) animals are defective in gut granule biogenesis. Double mutant analysis suggests that pgp-2(+) functions in parallel with the AP-3 adaptor complex during gut granule formation. We find that pgp-2 is expressed in the intestine where it functions in gut granule biogenesis and that PGP-2 localizes to the gut granule membrane. These results support a direct role of an ABC transporter in regulating lysosome biogenesis. Previously, pgp-2(+) activity has been shown to be necessary for the accumulation of Nile Red-stained fat in C. elegans. We show that gut granules are sites of fat storage in C. elegans embryos and adults. Notably, levels of triacylglycerides are relatively normal in animals defective in the formation of gut granules. Our results provide an explanation for the loss of Nile Red-stained fat in pgp-2(-) animals as well as insight into the specialized function of this lysosome-related organelle.