BackgroundSapria himalayana(Rafflesiaceae) is an endoparasitic plant characterized by a greatly reduced vegetative body and giant flowers; however, the mechanisms underlying its special lifestyle and greatly altered plant form remain unknown. To illustrate the evolution and adaptation ofS. himalayasna, we report its de novo assembled genome and key insights into the molecular basis of its floral development, flowering time, fatty acid biosynthesis, and defense responses.ResultsThe genome ofS. himalayanais ~ 1.92 Gb with 13,670 protein-coding genes, indicating remarkable gene loss (~ 54%), especially genes involved in photosynthesis, plant body, nutrients, and defense response. Genes specifying floral organ identity and controlling organ size were identified inS. himalayanaandRafflesia cantleyi, and showed analogous spatiotemporal expression patterns in both plant species. Although the plastid genome had been lost, plastids likely biosynthesize essential fatty acids and amino acids (aromatic amino acids and lysine). A set of credible and functional horizontal gene transfer (HGT) events (involving genes and mRNAs) were identified in the nuclear and mitochondrial genomes ofS. himalayana, most of which were under purifying selection. Convergent HGTs inCuscuta, Orobanchaceae, andS. himalayanawere mainly expressed at the parasite–host interface. Together, these results suggest that HGTs act as a bridge between the parasite and host, assisting the parasite in acquiring nutrients from the host.ConclusionsOur results provide new insights into the flower development process and endoparasitic lifestyle of Rafflesiaceae plants. The amount of gene loss inS. himalayanais consistent with the degree of reduction in its body plan. HGT events are common among endoparasites and play an important role in their lifestyle adaptation.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12915-023-01620-3.