Lactation appears to be an ancient reproductive trait that predates the origin of mammals. The synapsid branch of the amniote tree that separated from other taxa in the Pennsylvanian (>310 million years ago) evolved a glandular rather than scaled integument. Repeated radiations of synapsids produced a gradual accrual of mammalian features. The mammary gland apparently derives from an ancestral apocrine-like gland that was associated with hair follicles. This association is retained by monotreme mammary glands and is evident as vestigial mammary hair during early ontogenetic development of marsupials. The dense cluster of mammo-pilo-sebaceous units that open onto a nipple-less mammary patch in monotremes may reflect a structure that evolved to provide moisture and other constituents to permeable eggs. Mammary patch secretions were coopted to provide nutrients to hatchlings, but some constituents including lactose may have been secreted by ancestral apocrine-like glands in early synapsids. Advanced Triassic therapsids, such as cynodonts, almost certainly secreted complex, nutrient-rich milk, allowing a progressive decline in egg size and an increasingly altricial state of the young at hatching. This is indicated by the very small body size, presence of epipubic bones, and limited tooth replacement in advanced cynodonts and early mammaliaforms. Nipples that arose from the mammary patch rendered mammary hairs obsolete, while placental structures have allowed lactation to be truncated in living eutherians.