The synthesis of di-myo-inositol phosphate (DIP), a common compatible solute in hyperthermophiles, involves the consecutive actions of inositol-1-phosphate cytidylyltransferase (IPCT) and di-myoinositol phosphate phosphate synthase (DIPPS). In most cases, both activities are present in a single gene product, but separate genes are also found in a few organisms. Genes for IPCT and DIPPS were found in the genomes of 33 organisms, all with thermophilic/hyperthermophilic lifestyles. Phylogeny of IPCT/DIPPS revealed an incongruent topology with 16S RNA phylogeny, thus suggesting horizontal gene transfer. The phylogenetic tree of the DIPPS domain was rooted by using phosphatidylinositol phosphate synthase sequences as out-group. The root locates at the separation of genomes with fused and split genes. We propose that the gene encoding DIPPS was recruited from the biosynthesis of phosphatidylinositol. The last DIP-synthesizing ancestor harboured separated genes for IPCT and DIPPS and this architecture was maintained in a crenarchaeal lineage, and transferred by horizontal gene transfer to hyperthermophilic marine Thermotoga species. It is plausible that the driving force for the assembly of those two genes in the early ancestor is related to the acquired advantage of DIP producers to cope with high temperature. This work corroborates the view that Archaea were the first hyperthermophilic organisms.