Carotenoids are colored compounds produced by plants, fungi, and microorganisms and are required in the diet of most animals for oxidation control or light detection. Pea aphids display a red-green color polymorphism, which influences their susceptibility to natural enemies, and the carotenoid torulene occurs only in red individuals. Unexpectedly, we found that the aphid genome itself encodes multiple enzymes for carotenoid biosynthesis. Phylogenetic analyses show that these aphid genes are derived from fungal genes, which have been integrated into the genome and duplicated. Red individuals have a 30-kilobase region, encoding a single carotenoid desaturase that is absent from green individuals. A mutation causing an amino acid replacement in this desaturase results in loss of torulene and of red body color. Thus, aphids are animals that make their own carotenoids.