Motilin is an endogenous peptide hormone almost exclusively expressed in the human gastrointestinal (GI) tract. It activates the motilin receptor (MTLR), a class A G protein–coupled receptor (GPCR), and stimulates GI motility. To our knowledge, MTLR is the first GPCR reported to be activated by macrolide antibiotics, such as erythromycin. It has attracted extensive attention as a potential drug target for GI disorders. We report two structures of G
q
-coupled human MTLR bound to motilin and erythromycin. Our structures reveal the recognition mechanism of both ligands and explain the specificity of motilin and ghrelin, a related gut peptide hormone, for their respective receptors. These structures also provide the basis for understanding the different recognition modes of erythromycin by MTLR and ribosome. These findings provide a framework for understanding the physiological regulation of MTLR and guiding drug design targeting MTLR for the treatment of GI motility disorders.