The clustered homeotic genes encode transcription factors that regulate pattern formation in all animals, conferring cell fates by coordinating the activities of downstream ‘target’ genes. In the Drosophila midgut, the Ultrabithorax (Ubx) protein activates and the abdominalA (abd-A) protein represses transcription of the decapentaplegic (dpp) gene, which encodes a secreted signalling protein of the TGF beta class. We have identified an 813 bp dpp enhancer which is capable of driving expression of a lacZ gene in a correct pattern in the embryonic midgut. The enhancer is activated ectopically in the visceral mesoderm by ubiquitous expression of Ubx or Antennapedia but not by Sex combs reduced protein. Ectopic expression of abd-A represses the enhancer. Deletion analysis reveals regions required for repression and activation. A 419 bp subfragment of the 813 bp fragment also drives reporter gene expression in an appropriate pattern, albeit more weakly. Evolutionary sequence conservation suggests other factors work with homeotic proteins to regulate dpp. A candidate cofactor, the extradenticle protein, binds to the dpp enhancer in close proximity to homeotic protein binding sites. Mutation of either this site or another conserved motif compromises enhancer function. A 45 bp fragment of DNA from within the enhancer correctly responds to both UBX and ABD-A in a largely tissue-specific manner, thus representing the smallest in vivo homeotic response element (HOMRE) identified to date.