The photosynthetic protist Euglena gracilis contains chloroplasts surrounded by three membranes which arise from secondary endosymbiosis. The genes petA and petD, encoding cytochrome f and subunit IV of the cytochrome bf complex, normally present in chloroplast genomes, are lacking from the chloroplast DNA (cpDNA) of E. gracilis. The bf complex of E. gracilis was isolated, and the identities of cytochrome f and subunit IV were established immunochemically, by heme-specific staining, and by Edman degradation. Based on N-terminal and conserved internal protein sequences, primers were designed and used for PCR gene amplification and cDNA sequencing. The complete sequence of the petA cDNA and the partial sequence of the petD cDNA from E. gracilis are described. Evidence is provided that in this protist, the petA and petD genes have migrated from the chloroplast to the nucleus. Both genes exhibit a typical nuclear codon usage, clearly distinct from the usage of chloroplast genes. The petA gene encodes an atypical cytochrome f, with a unique insertion of 62 residues not present in other f-type cytochromes. The petA gene also acquired a region that encodes a large tripartite chloroplast transit peptide (CTP), which is thought to allow the import of apocytochrome f through the three-membrane envelope of E. gracilis chloroplasts. This is the first description of petA and petD genes that are nucleus-localized.