Fatty acids, which are essential cell membrane constituents and fuel storage molecules, are thought to share a common evolutionary origin with polyketide toxins in eukaryotes. While fatty acids are primary metabolic products, polyketide toxins are secondary metabolites that are involved in ecologically relevant processes, such as chemical defence, and produce the adverse effects of harmful algal blooms. Selection pressures on such compounds may be different, resulting in differing evolutionary histories. Surprisingly, some studies of dinoflagellates have suggested that the same enzymes may catalyse these processes. Here we show the presence and evolutionary distinctiveness of genes encoding six key enzymes essential for fatty acid production in 13 eukaryotic lineages for which no previous sequence data were available (alveolates: dinoflagellates, Vitrella, Chromera; stramenopiles: bolidophytes, chrysophytes, pelagophytes, raphidophytes, dictyochophytes, pinguiophytes, xanthophytes; Rhizaria: chlorarachniophytes, haplosporida; euglenids) and 8 other lineages (apicomplexans, bacillariophytes, synurophytes, cryptophytes, haptophytes, chlorophyceans, prasinophytes, trebouxiophytes). The phylogeny of fatty acid synthase genes reflects the evolutionary history of the organism, indicating selection to maintain conserved functionality. In contrast, polyketide synthase gene families are highly expanded in dinoflagellates and haptophytes, suggesting relaxed constraints in their evolutionary history, while completely absent from some protist lineages. This demonstrates a vast potential for the production of bioactive polyketide compounds in some lineages of microbial eukaryotes, indicating that the evolution of these compounds may have played an important role in their ecological success.