The developing legs of Drosophila are subdivided into proximal and distal domains by the activity of the homeodomain proteins Homothorax (Hth) and Distal-less (Dll). The expression domains of Dll and Hth are initially reciprocal. Wingless and Dpp define both domains by activating Dll and by repressing Hth in the distal region of the disc. Wg and Dpp do not act through Dll to repress Hth. Hth functions to reduce the sensitivity of proximal cells to Wg and Dpp. This serves to limit the effective range of these signals in regulating later-acting genes such as Dac. We present evidence that proximal and distal cells tend to sort-out from one another. Cells forced to express Hth are unable to mix with distal cells. Likewise, cells forced to express Dll are unable to mix with proximal cells. Clones of cells unable to express Dll in the distal region sort-out from the disc. Clones of cells unable to express Hth lose the specialized population of cells at the interface between proximal and distal territories and cause fusion between body wall and leg segments. These observations suggest that sorting-out behavior of Hth- and Dll-expressing cells contributes to subdivision of the leg into proximal and distal domains.