Type II DNA topoisomerases of the family A (Topo IIA) are present in all bacteria (DNA gyrase) and eukaryotes. In eukaryotes, they play a major role in transcription, DNA replication, chromosome segregation and modulation of chromosome architecture. The origin of eukaryotic Topo IIA remains mysterious since they are very divergent from their bacterial homologues and have no orthologues in Archaea. Interestingly, eukaryotic Topo IIA have close homologues in viruses of the phylum Nucleocytoviricota, an expansive assemblage of large and giant viruses formerly known as the nucleocytoplasmic large DNA viruses (NCLDV). Topo IIA are also encoded by some bacterioviruses of the class Caudoviricetes (tailed bacteriophages). To elucidate the origin of the eukaryotic Topo IIA, we performed in-depth phylogenetic analyses combining viral and cellular Topo IIA homologs. Topo IIA encoded by bacteria and eukaryotes form two monophyletic groups nested within Topo IIA encoded by Caudoviricetes and Nucleocytoviricota, respectively. Importantly, Nucleocytoviricota remained well separated from eukaryotes after removing both bacteria and Caudoviricetes from the dataset, indicating that the separation of Nucleocytoviricota and eukaryotes is probably not due to long branch attraction artefact. The topology of our tree suggests that the eukaryotic Topo IIA was probably acquired from an ancestral member of the Nucleocytoviricota of the class Megaviricetes, before the emergence of the last eukaryotic common ancestor (LECA). This result further highlights a key role of these viruses in eukaryogenesis and suggests that early proto-eukaryotes used a Topo IIB instead of a Topo IIA for solving their DNA topological problems.