Although the dinophytes generally possess red-algal-derived secondary plastids, tertiary plastids originating from haptophyte and diatom ancestors are recognized in some lineages within the Dinophyta. However, little is known about the nuclear-encoded genes of plastid-targeted proteins from the dinophytes with diatom-derived tertiary plastids. We analyzed the sequences of the nuclear psbO gene encoding oxygen-evolving enhancer protein from various algae with red-algal-derived secondary and tertiary plastids. Based on our sequencing of 10 new genes and phylogenetic analysis of PsbO amino acid sequences from a wide taxon sampling of red algae and organisms with red-algal-derived plastids, dinophytes form three separate lineages: one composed of peridinin-containing species with secondary plastids, and the other two having haptophyte- or diatom-derived tertiary plastids and forming a robust monophyletic group with haptophytes and diatoms, respectively. Comparison of the N-terminal sequences of PsbO proteins suggests that psbO genes from a dinophyte with diatom-derived tertiary plastids (Kryptoperidinium) encode proteins that are targeted to the diatom plastid from the endosymbiotic diatom nucleus as in the secondary phototrophs, whereas the fucoxanthin-containing dinophytes (Karenia and Karlodinium) have evolved an additional system of psbO genes for targeting the PsbO proteins to their haptophyte-derived tertiary plastids from the host dinophyte nuclei.