A mammary gland is an organ in female mammals that produces milk to feed young offspring. Mammals get their name from the word "mammary." In humans, the mammary glands are situated in the breasts. In ruminants such as cows, goats, and deer, the mammary glands are contained in the udders. The mammary glands of mammals other than primates, such as dogs and cats, are sometimes called dugs.

The basic components of a mature mammary gland are the alveoli (hollow cavities, a few millimeters large) lined with milk-secreting cuboidal cells and surrounded by myoepithelial cells. These alveoli join to form groups known as lobules. Each lobule has a lactiferous duct that drains into openings in the nipple. The myoepithelial cells contract under the stimulation of oxytocin, excreting the milk secreted by alveolar units into the lobule lumen toward the nipple. As the infant begins to suck, the oxytocin-mediated "let down reflex" ensues and the mother's milk is secreted — not sucked from the gland — into the baby's mouth.

All the milk-secreting tissue leading to a single lactiferous duct is called a "simple mammary gland"; in a "complex mammary gland" all the simple mammary glands serve one nipple. Humans normally have two complex mammary glands, one in each breast, and each complex mammary gland consists of 10–20 simple glands. The presence of more than two nipples is known as polythelia and the presence of more than two complex mammary glands as polymastia.

Maintaining the correct polarized morphology of the lactiferous duct tree requires another essential component – mammary epithelial cells extracellular matrix (ECM) which, together with adipocytes, fibroblast, inflammatory cells, and others, constitute mammary stroma.[4] Mammary epithelial ECM mainly contains myoepithelial basement membrane and the connective tissue. They not only help to support mammary basic structure, but also serve as a communicating bridge between mammary epithelia and their local and global environment throughout this organ's development.[5][6]

A mammary gland is a specific type of apocrine gland specialized for manufacture of colostrum when giving birth. Mammary glands can be identified as apocrine because they exhibit striking "decapitation" secretion. Many sources assert that mammary glands are modified sweat glands.[7][8][9] Some authors dispute that and argue instead that they are sebaceous glands.[7]

Mammary glands develop during different growth cycles. They exist in both sexes during embryonic stage, forming only a rudimentary duct tree at birth. In this stage, mammary gland development depends on systemic (and maternal) hormones,[4] but is also under the (local) regulation of paracrine communication between neighboring epithelial and mesenchymal cells by parathyroid hormone-related protein(PTHrP).[10] This locally secreted factor gives rise to a series of outside-in and inside-out positive feedback between these two types of cells, so that mammary bud epithelial cells can proliferate and sprout down into the mesenchymal layer until they reach the fat pad to begin the first round of branching.[4] At the same time, the embryonic mesenchymal cells around the epithelial bud receive secreting factors activated by PTHrP, such as BMP4. These mesenchymal cells can transform into a dense, mammary-specific mesenchyme, which later develop into connective tissue with fibrous threads, forming blood vessels and the lymph system.[11] A basement membrane, mainly containing laminin and collagen, formed afterward by differentiated myoepithelial cells, keeps the polarity of this primary duct tree.

Lactiferous duct development occurs in females in response to circulating hormones. First development is frequently seen during pre- and postnatal stages, and later during puberty. Estrogen promotes branching differentiation,[12] whereas in males testosterone inhibits it. A mature duct tree reaching the limit of the fat pad of the mammary gland comes into being by bifurcation of duct terminal end buds (TEB), secondary branches sprouting from primary ducts[5][13] and proper duct lumen formation. These processes are tightly modulated by components of mammary epithelial ECM interacting with systemic hormones and local secreting factors. However, for each mechanism the epithelial cells' "niche" can be delicately unique with different membrane receptor profiles and basement membrane thickness from specific branching area to area, so as to regulate cell growth or differentiation sub-locally.[14] Important players include beta-1 integrin, epidermal growth factor receptor (EGFR), laminin-1/5, collagen-IV, matrix metalloproteinase(MMPs), heparan sulfate proteoglycans, and others. Elevated circulating level of growth hormone and estrogen get to multipotent cap cells on TEB tips through a thin, leaky layer of basement membrane. These hormones promote specific gene expression. Hence cap cells can differentiate into myoepithelial and luminal (duct) epithelial cells, and the increased amount of activated MMPs can degrade surrounding ECM helping duct buds to reach further in the fat pads.[15][16] On the other hand, basement membrane along the mature mammary ducts is thicker, with strong adhesion to epithelial cells via binding to integrin and non-integrin receptors. When side branches develop, it is a much more “pushing-forward” working process including extending through myoepithelial cells, degrading basement membrane and then invading into a periductal layer of fibrous stromal tissue.[5] Degraded basement membrane fragments (laminin-5) roles to lead the way of mammary epithelial cells migration.[17] Whereas, laminin-1 interacts with non-integrin receptor dystroglycan negatively regulates this side branching process in case of cancer.[18] These complex "Yin-yang" balancing crosstalks between mammary ECM and epithelial cells "instruct" healthy mammary gland development until adult.

There is preliminary evidence that soybean intake mildly stimulates the breast glands in pre- and postmenopausal women.[19]

Secretory alveoli develop mainly in pregnancy, when rising levels of prolactin, estrogen, and progesterone cause further branching, together with an increase in adipose tissue and a richer blood flow. In gestation, serum progesterone remains at a stably high concentration so signaling through its receptor is continuously activated. As one of the transcribed genes, Wnts secreted from mammary epithelial cells act paracrinely to induce more neighboring cells' branching.[20][21] When the lactiferous duct tree is almost ready, "leaves" alveoli are differentiated from luminal epithelial cells and added at the end of each branch. In late pregnancy and for the first few days after giving birth, colostrum is secreted. Milk secretion (lactation) begins a few days later due to reduction in circulating progesterone and the presence of another important hormone prolactin, which mediates further alveologenesis, milk protein production, and regulates osmotic balance and tight junction function. Laminin and collagen in myoepithelial basement membrane interacting with beta-1 integrin on epithelial surface again, is essential in this process.[22][23] Their binding ensures correct placement of prolactin receptors on the basal lateral side of alveoli cells and directional secretion of milk into lactiferous ducts.[22][23] Suckling of the baby causes release of the hormone oxytocin, which stimulates contraction of the myoepithelial cells. In this combined control from ECM and systemic hormones, milk secretion can be reciprocally amplified so as to provide enough nutrition for the baby.

During weaning, decreased prolactin, missing mechanical stimulation (baby suckling), and changes in osmotic balance caused by milk stasis and leaking of tight junctions cause cessation of milk production. In some species there is complete or partial involution of alveolar structures after weaning, in humans there is only partial involution and the level of involution in humans appears to be highly individual. The glands in the breast do secrete fluid also in nonlactating women.[24] In some other species (such as cows), all alveoli and secretory duct structures collapse by programmed cell death (apoptosis) and autophagy for lack of growth promoting factors either from the ECM or circulating hormones.[25][26] At the same time, apoptosis of blood capillary endothelial cells speeds up the regression of lactation ductal beds. Shrinkage of the mammary duct tree and ECM remodeling by various proteinase is under the control of somatostatin and other growth inhibiting hormones and local factors.[27] This major structural change leads loose fat tissue to fill the empty space afterward. But a functional lactiferous duct tree can be formed again when a female is pregnant again.

Tumorigenesis in mammary glands can be induced biochemically by abnormal expression level of circulating hormones or local ECM components,[28] or from a mechanical change in the tension of mammary stroma.[29] Under either of the two circumstances, mammary epithelial cells would grow out of control and eventually result in cancer. Almost all instances of breast cancer originate in the lobules or ducts of the mammary glands.

The constantly protruding breasts of the adult human female, unusually large relative to body size, are a unique evolutionary development whose purpose is not yet fully known (see breast); other mammals tend to have less conspicuous mammary glands that protrude only while actually filling with milk. The number and positioning of complex and simple mammary glands varies widely in different mammals. The nipples and glands can occur anywhere along the two milk lines, two nearly parallel lines along the ventral aspect of the body. In general most mammals develop mammary glands in pairs along these lines, with a number approximating the number of young typically birthed at a time. The number of nipples varies from 2 (in most primates) to 18 (in pigs). The Virginia Opossum has 13, one of the few mammals with an odd number.[30][31] The following table lists the number and position of glands normally found in a range of mammals:

Male mammals typically have rudimentary mammary glands and nipples, with a few exceptions: male mice do not have nipples,[34] and male horses lack nipples and mammary glands.[citation needed] The male Dayak fruit bat has lactating mammary glands.[35]Male lactation occurs infrequently in some species, including humans.

The evolution of the mammary gland is difficult to explain; this is because mammary glands are typically required by mammals to feed their young. There are many theories on how mammary glands evolved, for example, it is believed that the mammary gland is a transformed sweat gland, more closely related to apocrine sweat glands.[37] Since mammary glands do not fossilize well, supporting such theories with fossil evidence is difficult. Many of the current theories are based on comparisons between lines of living mammals – monotremes, marsupials and eutherians. One theory proposes that mammary glands evolved from glands that were used to keep the eggs of early mammals moist[38][39] and free from infection[40][41] (monotremes still lay eggs). Other theories suggest that early secretions were used directly by hatched young,[42] or that the secretions were used by young to help them orient to their mothers.[43]

Lactation is assumed to have developed long before the evolution of the mammary gland and mammals; see evolution of lactation.