During postembryonic development in C. elegans, posterior-specific pattern formation requires the gene mab-5. Within the posterior body region, mab-5 activity controls epidermal, neuronal, and mesodermal cell differentiation, and also the direction of cell migration. Here, we show that mab-5 RNA is localized in the posterior body region, indicating that mab-5 activity is targeted to posterior cells, at least in part, by a mechanism that operates at the level of mab-5 RNA synthesis or stabilization. We also show that mab-5 contains a homeobox similar to that of the Drosophila Antennapedia gene. This suggests that mab-5 influences cell differentiation and cell migration by regulating gene expression, and clearly demonstrates that genes containing homeoboxes influence global aspects of pattern formation in organisms other than Drosophila.