Melamine poisoning has become widely publicized after a recent occurrence of renal injury in infants and children exposed to melamine-tainted milk in China. This renal damage is believed to result from kidney stones formed from melamine and uric acid or from melamine and its cocrystallizing chemical derivative, cyanuric acid. However, the composition of the stones and the mechanism by which the stones are formed in the renal tubules are unknown. We report that cyanuric acid can be produced in the gut by microbial transformation of melamine and serves as an integral component of the kidney stones responsible for melamine-induced renal toxicity in rats. Melamine-induced toxicity in rats was attenuated and melamine excretion increased after antibiotic suppression of gut microbial activity [corrected]. We further demonstrated that melamine is converted to cyanuric acid in vitro by bacteria cultured from normal rat feces; Klebsiella was subsequently identified in fecal samples by 16S ribosomal DNA sequencing. In culture, Klebsiella terrigena was shown to convert melamine to cyanuric acid directly. Rats colonized by K. terrigena showed exacerbated melamine-induced nephrotoxicity. Cyanuric acid was detected in the kidneys of rats administered melamine alone, and the concentration after Klebsiella colonization was increased. These findings suggest that the observed toxicity of melamine may be conditional on the exact composition and metabolic activities of the gut microbiota.