We cloned and characterized a new leech homeobox gene, Lox4, a homolog of the Drosophila genes Ultrabithorax and abdominal-A. Lox4 has a complex and dynamic pattern of expression within a series of segmentally homologous neurons. These include a pair of specialized motor neurons of one segmental ganglion, the rostral penile evertors (RPEs), and their segmental homologs in other midbody ganglia. During gangliogenesis, Lox4 was expressed within this series of neurons in three different temporal patterns: (1) it was never expressed in the RPE homologs of ganglia 1–3; (2) it was expressed in the RPEs during gangliogenesis, but was turned off when these neurons started to differentiate after gangliogenesis; and (3) it was expressed in the RPE homologs of segments 4–5 and 7–21 during gangliogenesis and the subsequent period of axonogenesis. We found that these neurons have three distinct peripheral axonal morphologies that correlate with the three temporal patterns of expression. Our results suggest that the homeobox gene Lox4 may determine neuronal identities within this series of segmental homologs.