The transition of free-living organisms to parasitic organisms is a mysterious process that occurs in all major eukaryotic lineages. Parasites display seemingly unique features associated with their pathogenicity; however, it is important to distinguish ancestral preconditions to parasitism from truly new parasite-specific functions. Here, we sequenced the genome and transcriptome of anaerobic free-living M. balamuthi and performed phylogenomic analysis of four related members of the Archamoebae, including Entamoeba histolytica, an important intestinal pathogen of humans. We aimed to trace gene histories throughout the adaptation of the aerobic ancestor of Archamoebae to anaerobiosis and throughout the transition from a free-living to a parasitic lifestyle. These events were associated with massive gene losses that, in parasitic lineages, resulted in a reduction in structural features, complete losses of some metabolic pathways, and a reduction in metabolic complexity. By reconstructing the features of the common ancestor of Archamoebae, we estimated preconditions for the evolution of parasitism in this lineage. The ancestor could apparently form chitinous cysts, possessed proteolytic enzyme machinery, compartmentalized the sulfate activation pathway in mitochondrion-related organelles, and possessed the components for anaerobic energy metabolism. After the split of Entamoebidae, this lineage gained genes encoding surface membrane proteins that are involved in host-parasite interactions. In contrast, gene gains identified in the M. balamuthi lineage were predominantly associated with polysaccharide catabolic processes. A phylogenetic analysis of acquired genes suggested an essential role of lateral gene transfer in parasite evolution (Entamoeba) and in adaptation to anaerobic aquatic sediments (Mastigamoeba).