It has been known for decades that some insect-infecting trypanosomatids can survive in culture without heme supplementation while others cannot, and that this capability is associated with the presence of a betaproteobacterial endosymbiont in the flagellate's cytoplasm. However, the specific mechanisms involved in this process remained obscure. In this work, we sequence and phylogenetically analyze the heme pathway genes from the symbionts and from their hosts, as well as from a number of heme synthesis-deficient Kinetoplastida. Our results show that the enzymes responsible for synthesis of heme are encoded on the symbiont genomes and produced in close cooperation with the flagellate host. Our evidence suggests that this synergistic relationship is the end result of a history of extensive gene loss and multiple lateral gene transfer events in different branches of the phylogeny of the Trypanosomatidae.