The effects of mutations in five anterior gap genes (hkb, tll, otd, ems and btd) on the spatial expression of the segment polarity genes, wg and hh, were analyzed at the late blastoderm stage and during subsequent development. Both wg and hh are normally expressed at blastoderm stage in two broad domains anterior to the segmental stripes of the trunk region. At the blastoderm stage, each gap gene acts specifically to regulate the expression of either wg or hh in the anterior cephalic region: hkb, otd and btd regulate the anterior blastoderm expression of wg, while tll and ems regulate hh blastoderm expression. Additionally, btd is required for the first segmental stripe (mandibular segment) of both hh and wg at blastoderm stages. The subsequent segmentation of the cephalic segments (preantennal, antennal and intercalary) appears to be dependent on the overlap of the wg and hh cephalic domains as defined by these gap genes at the blastoderm stage. None of these five known gap genes are required for the activation of the labral segment domains of hh and wg, which are presumably either activated directly by maternal pathways or by an unidentified gap gene.