Homeotic genes often use autoregulation as a mechanism to maintain their expression. Autoregulation of Ultrabithorax (Ubx) in the visceral mesoderm is at least partly indirect and mediated by extracellular signalling from wingless (wg) and decapentaplegic (dpp). Ubx controls the localized expression of these two extracellular proteins. Here, we identify separate wg and dpp response elements within upstream sequences of Ubx. Our evidence suggests that there are two distinct response factors each of which, after signal-induced activation, mediates transcriptional activation through its cognate element, whereas each element is recognized by a repressor in the absence of the corresponding signal. We show that the response factors and other components for transmission of the wg and, probably, of the dpp signal are present throughout the midgut mesoderm. Thus, there may be ubiquitous repression, preventing Ubx autoregulation throughout the visceral mesoderm, which is relieved locally by wg and dpp signalling. Evidently, the two signals convey positional information, allowing visceral mesoderm cells to reassess their position at advanced stages of embryogenesis and to decide whether or not to maintain expression of a homeotic gene.