Here, we show that BarH1 and BarH2, a pair of Bar homeobox genes, play essential roles in the formation and specification of the distal leg segments of Drosophila. In early third instar, juxtaposition of Bar-positive and Bar-negative tissues causes central folding that may separate future tarsal segments 2 from 3, while juxtaposition of tissues differentially expressing Bar homeobox genes at later stages gives rise to segmental boundaries of distal tarsi including the tarsus/pretarsus boundary. Tarsus/pretarsus boundary formation requires at least two different Bar functions, early antagonistic interactions with a pretarsus-specific homeobox gene, aristaless, and the subsequent induction of Fas II expression in pretarsus cells abutting tarsal segment 5. Bar homeobox genes are also required for specification of distal tarsi. Bar expression requires Distal-less but not dachshund, while early circular dachshund expression is delimited interiorly by BarH1 and BarH2.