Lepidoptera contains near 160,000 described species and most of them are specialist herbivores that use restricted plant species as hosts. Speciation that originated from host shift is one of the important factors for the diversification of Lepidoptera. Because plants prepare secondary metabolites for defense against the herbivores, with various profiles of the components among different plant taxa, the specialist herbivores need to be adapted to the toxic substances unique to their host plants. Swallowtail butterflies of the genus Papilio consists of over 200 species. Approximately 80% of them utilize Rutaceae plants, and among the remaining species, a specific subgroup uses phylogenetically distant Apiaceae plants as larval hosts. Rutaceae and Apiaceae commonly contain toxic secondary metabolites, furanocoumarins, and molecular phylogenetic studies support the concept that Apiaceae feeders were derived from Rutaceae feeders. Molecular mechanisms underlying furanocoumarin tolerance in Papilio butterflies have been investigated almost exclusively in an Apiaceae feeder by an in vitro assay. In contrast, there is little information regarding the Rutaceae feeders. Here, we focused on a Rutaceae feeder, P. xuthus, and identified two furanocoumarin-responsive cytochrome P450-6B (CYP6B) genes, of which one was an ortholog of a furanocoumarin-metabolizing-enzyme identified in the Apiaceae-feeding Papilio while the other was previously unreported. We further conducted in vivo functional analysis using the CRISPR/Cas9 system, revealing a contribution of these CYP6Bs to furanocoumarin tolerance of P. xuthus larvae. Our findings suggest that co-option of furanocoumarin-metabolizing CYP6B enzymes at least partially contributed to the host shift from Rutaceae to Apiaceae in Papilio butterflies.