Abstract Background Sapria 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 of S. 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. Results The genome of S. himalayana is ~ 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 in S. himalayana and Rafflesia 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 of S. himalayana, most of which were under purifying selection. Convergent HGTs in Cuscuta, Orobanchaceae, and S. himalayana were 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. Conclusions Our results provide new insights into the flower development process and endoparasitic lifestyle of Rafflesiaceae plants. The amount of gene loss in S. himalayana is 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.