The DNA-binding homeobox motif was first identified in several Drosophila homeotic genes but also in fushi tarazu, a gene found in the Hox cluster yet involved in segmentation, not anteroposterior patterning . Homeotic transformations are not seen in insect ftz mutants, and insect ftz genes do not have Hox-like expression except within the nervous system [2,3]. Insect ftz homeobox sequences link them to the Antp-class genes and Tribolium and Schistocerca orthologs have Antp-class YPWM motifs amino-terminal to the homeobox [2,3]. Orthologs of ftz cloned from a centipede and an onychophoran  show that it predates the emergence of the arthropods, but the inability to pinpoint non-arthropodan orthologs suggested that ftz is the product of a Hox gene duplication in the arthropod ancestor [4,5]. I have cloned ftz orthologs from a mite and a tardigrade, arthropod outgroups of the insects . Mite ftz is expressed in a Hox-like pattern, confirming its ancestral role in anteroposterior patterning. Phylogenetic analyses indicate that arthropod ftz genes are orthologous to the Lox5 genes of lophotrochozoans (a group that includes molluscs)  and, possibly, with the Mab-5 genes of nematodes and Hox6 genes of deuterostomes and would therefore have been present in the triploblast ancestor.
Telford, M. J. (2000). Evidence for the derivation of the Drosophila fushi tarazu gene from a Hox gene orthologous to lophotrochozoan Lox5. Current Biology, 10(6), 349–352. https://doi.org/10.1016/S0960-9822(00)00387-0