During anuran metamorphosis from herbivorous tadpoles to carnivorous frogs, the gastrointestinal (GI) tract undergoes drastic remodeling, such as the formation of the stomach-intestine boundary and the development of the pyloric sphincter at the posterior end of the stomach. However, the morphogenetic process and molecular mechanisms of how the pyloric sphincter is formed during metamorphosis, instead of during embryogenesis as in amniotes, are largely uninvestigated. Using the African clawed frog Xenopus laevis, we histologically examined the development of the pylorus region from embryonic to froglet stages and performed spatiotemporal gene expression analyses. We found that the pyloric sphincter is formed at a flexure within the pyloric region during metamorphic climax, and that the pyloric and duodenal epithelia, which are morphologically indistinguishable before sphincter formation, become clearly demarcated by the sphincter at the end of metamorphosis. Consistent with these morphological changes, expression domains of a stomach marker barx1 and an intestine marker cdx2 overlapped until late metamorphic climax, but became separated after metamorphosis. Despite the absence of the sphincter before metamorphosis, various genes crucial for sphincter formation in amniotes were already expressed in the pylorus region of Xenopus embryos. RNA-sequencing analysis at pre-metamorphic and metamorphic-climax stages suggest unappreciated roles of genes, such as those for retinoic acid signaling and various transcription factors, in suppressing or promoting sphincter formation. These data provide histological and molecular insights into the heterochrony of the pyloric sphincter formation in amniotes and anurans.