The first morphogenetic movement during Drosophila development is the invagination of the mesoderm, an event that folds a one-layered epithelium into a multilayered structure. In this paper, we describe the shape changes and behaviour of the cells participating in this process and show how mutations that change cell fate affect this behaviour. We divide the formation of the mesodermal germ layer into two phases. During the first phase, the ventral epithelium folds into a tube by a series of concerted cell shape changes (ventral furrow formation). Based on the behaviour of cells in this phase, we conclude that the prospective mesoderm is not a homogeneous cell population, but consists of two subpopulations. Each subpopulation goes through a distinctive sequence of specific cell shape changes which together mediate the invagination of the ventral furrow. In the second phase, the invaginated tube of mesoderm loses its epithelial character, the mesoderm cells disperse, divide and then spread out along the ectoderm to form a single cell layer. To test how ventral furrow formation depends on cell fates in the mesoderm and in neighbouring cells we alter these fates genetically using maternal and zygotic mutations. These experiments show that some of the aspects of cell behaviour specific for ventral furrow cells are part of an autonomous differentiation programme. The force driving the invagination is generated within the region of the ventral furrow, with the lateral and dorsal cell populations contributing little or none of the force. Two known zygotic genes that are required for the formation of the mesoderm, twist and snail, are expressed in ventral furrow cells, and the correct execution of cell shape changes in the mesoderm depends on both. Finally, we show that the region where the ventral furrow forms is determined by the expression of mesoderm-specific genes, and not by mechanical or other epigenetic properties of the egg.