Marine Group II (MGII) archaea represent the most abundant planktonic archaeal group in ocean surface waters, but our understanding of the group has been limited by a lack of cultured representatives and few sequenced genomes. Here, we conducted a comparative phylogenomic analysis of 270 recently available MGII metagenome-assembled genomes (MAGs) to investigate their evolution and ecology. Based on a rank-normalised genome phylogeny, we propose that MGII is an order-level lineage for which we propose the name Candidatus Poseidoniales (after Gr. n. Poseidon, God of the sea), comprising the families Candidatus Poseidonaceae fam. nov. (formerly subgroup MGIIa) and Candidatus Thalassarchaeaceae fam. nov. (formerly subgroup MGIIb). Within these families, 21 genera could be resolved, many of which had distinct biogeographic ranges and inferred nutrient preferences. Phylogenetic analyses of key metabolic functions suggest that the ancestor of Ca. Poseidoniales was a surface water-dwelling photoheterotroph that evolved to occupy multiple related ecological niches based primarily on spectral tuning of proteorhodopsin genes. Interestingly, this adaptation appears to involve an overwrite mechanism whereby an existing single copy of the proteorhodopsin gene is replaced by a horizontally transferred copy, which in many instances should allow an abrupt change in light absorption capacity. Phototrophy was lost entirely from five Ca. Poseidoniales genera coinciding with their adaptation to deeper aphotic waters. We also report the first instances of nitrate reductase in two genera acquired via horizontal gene transfer (HGT), which was a potential adaptation to oxygen limitation. Additional metabolic traits differentiating families and genera include flagellar-based adhesion, transporters, and sugar, amino acid, and peptide degradation. Our results suggest that HGT has shaped the evolution of Ca. Poseidoniales to occupy a variety of ecological niches and to become the most successful archaeal lineage in ocean surface waters.