Drosophila homoeotic genes control the formation of external morphological features of the embryo and adult, and in addition affect differentiation of the nervous system. Here we describe the morphogenetic events in the midgut that are controlled by the homoeotic genes Sex combs reduced (Scr) and Antennapedia (Antp). The midgut is composed of two cell layers, an inner endoderm and an outer visceral mesoderm that surround the yolk. Scr and Antp are expressed in the visceral mesoderm but not in the endoderm. The two genes are required for different aspects of the midgut morphogenesis. In Scr null mutant embryos the gastric caeca fail to form. Scr is expressed in the visceral mesoderm cells posterior to the primordia of the gastric caeca and appears to be indirectly required for the formation of the caeca. Antp is expressed in visceral mesoderm cells that overlie a part of the midgut where a constriction will form, and Antp null mutant embryos fail to form this constriction. An ultrastructural analysis of the midgut reveals that the visceral mesoderm imposes the constriction on the endoderm and the yolk. The mesodermal tissue contracts within the constriction and thereby penetrates the layer of the midgut endoderm. Microtubules participate in the morphological changes of the visceral mesoderm cells. The analysis of the expression of Scr in Antp mutant embryos revealed a case of tissue-specific regulation of Scr expression by Antp. In the epidermis, Antp has been shown to negatively regulate Scr, but it positively regulates Scr in the visceral mesoderm.