The layer of cells in the gastrula that lies between the ectoderm and endoderm. It develops into the muscles, circulatory system, and reproductive organs (excluding the germ cells), and in vertebrates also into the excretory system and skeleton. See also germ layers.