The degeneration of the prothoracic glands of Drosophila melanogaster during pupal-adult metamorphosis was analyzed by light microscopy, scanning, and transmission electron microscopy. The ultrastructural observations were correlated with the ability of the ring gland to synthesize ecdysteroids in vitro. The ring gland is prominent during larval life and is identifiable until just before adult eclosion but undergoes dramatic changes in location, shape, size, ultrastructure, and function during pupal-adult development. Prothoracic gland degeneration is characterized by: a gradual decrease in its ability to synthesize ecdysteroids; a decreasing quantity of smooth endoplasmic reticulum (SER) and mitochondria; the absence of intercellular channels; cytoplasmic fragmentation; and the separation of the prothoracic gland from the corpus allatum and corpus cardiacum. An ultrastructural analysis of the corpus allatum during larval-pupal-adult metamorphosis and adult life was also correlated with function, i.e., juvenile hormone biosynthesis, using a radiochemical assay of ring glands and adult corpora allata in vitro. A relatively high concentration of SER, mitochondria, and mitochondrion-scalariform junction complexes are typical features of an active corpus allatum cell. The migration of the corpus allatum from the ring gland to its position as a separate gland in the adult fly was studied in detail. The capacity of the corpus allatum to synthesize juvenile hormone is at its peak in the ring gland of the early wandering third instar larva, whereas the corpus allatum of 2-day-old female adults displayed the greatest synthetic activity during adult life. The physiological significance of the alterations in gland activity is discussed.