Cyanophages are viruses that infect cyanobacteria. An interesting feature of many of them is the presence of psbA and psbD, genes that encode D1 and D2 proteins, respectively. The D1 and D2 are core proteins of the photosystem II (PSII) in cyanobacteria, algae and plants and influence the proper function of oxygenic photosynthesis (OP) in all oxyphototrophs on Earth. The frequent occurrence of psbA and psbD in cyanophages raises the question whether these genes coevolved with hosts during the early stages of cyanophage and cyanobacterial evolution, or whether they are direct descendants of genes adopted from the genomes of cyanobacterial hosts. The phylogeny of D1/D2 proteins encoded in the genomes of selected cyanophages and oxyphototrophs was reconstructed. In addition, common ancestral sequences of D1 and D2 proteins were predicted for cyanophages and oxyphototrophs. Based on this, the reconstruction of the 3D structures of D1 and D2 proteins was performed. In addition, the ratio of non-synonymous to synonymous (dN/dS) nucleotide substitutions in the coding sequences (CDSs) of psbA and psbD was determined. The results of the predicted spatial structures of the D1 and D2 proteins and purifying selection for the CDSs of psbA and psbD suggest that they belong to the ancient proteins, which may have formed the primordial PSII. It cannot be ruled out that they involved in water oxidation in cyanobacteria-like organisms at early stages of the evolution of life on Earth and coevolved with ancient cyanophages. The data are also discussed in the context of the origin of viruses.