The Nkx5/HMX homeodomain protein MLS-2 is required for proper tube cell shape in the C. elegans excretory system. Cells perform wide varieties of functions that are facilitated, in part, by adopting unique shapes. Many of the genes and pathways that promote cell fate specification have been elucidated. However, relatively few transcription factors have been identified that promote shape acquisition after fate specification. Here we show that the Nkx5/HMX homeodomain protein MLS-2 is required for cellular elongation and shape maintenance of two tubular epithelial cells in the C. elegans excretory system, the duct and pore cells. The Nkx5/HMX family is highly conserved from sea urchins to humans, with known roles in neuronal and glial development. MLS-2 is expressed in the duct and pore, and defects in mls-2 mutants first arise when the duct and pore normally adopt unique shapes. MLS-2 cooperates with the EGF-Ras-ERK pathway to turn on the LIN-48/Ovo transcription factor in the duct cell during morphogenesis. These results reveal a novel interaction between the Nkx5/HMX family and the EGF-Ras pathway and implicate a transcription factor, MLS-2, as a regulator of cell shape.