Swallowtail butterflies belonging to the family of Papilionidae selectively utilize a limited number of plants from a single or a few families. Female butterflies lay eggs on their host only when they detect specific chemicals through their foreleg chemosensilla while drumming on the leaf surface. Here we show that the butterfly, Papilio xuthus, uses a gustatory receptor specific for synephrine to select its host in oviposition behaviour. We identify a gustatory receptor gene involved in the recognition of an oviposition stimulant, synephrine, from the P. xuthus by a combination of in silico, in vitro and in vivo approaches. The receptor, PxutGr1, responds specifically to synephrine in Sf9 cells. The sensitivity of tarsal taste sensilla to synephrine and the oviposition behaviour in response to synephrine are strongly reduced after injecting double-stranded RNA of PxutGr1 into pupae. These observations indicate that the receptor PxutGr1 represents a key factor in host specialization in P. xuthus.