ABSTRACT The gut of Drosophila consists of ectodermally derived foregut and hindgut and endodermally derived midgut. Here I show that the gene serpent plays a key role in the development of the endoderm. serpent embryos lack the entire midgut and do not show endodermal differentiation. They gastrulate normally and form proper amnioproctodeal and anterior midgut invaginations. However, the prospective anterior midgut cells acquire properties that are usually found in ectodermal foregut cells. In the posterior region of the embryo, the prospective posterior midgut forms an additional hindgut which is contiguous with the normal hindgut and which appears to be a serial duplication, not a mere enlargement of the hindgut. The fate shifts in both the anterior and the posterior part of the srp embryo can be described in terms of homeotic transformations of anterior midgut to foregut and of posterior midgut to hindgut. serpent appears to act as a homeotic gene downstream of the terminal gap gene huckebein and to promote morphogenesis and differentiation of anterior and posterior midgut.