The adult, virgin mammary gland is a highly organized tree-like structure formed by ducts with hollowed lumen. Although lumen formation during pubertal development appears to involve apoptosis, the molecular mechanisms that regulate this process are not known. Here, we demonstrate that disruption of the BH3-only proapoptotic factor Bim in mice prevents induction of apoptosis in and clearing of the lumen in terminal end buds during puberty. However, cells that fill the presumptive luminal space are eventually cleared from the adjacent ducts by a caspase-independent death process. Within the filled Bim(-/-) ducts, epithelial cells are deprived of matrix attachment and undergo squamous differentiation prior to clearing. Similarly, we also detect squamous differentiation in vitro when immortalized mammary epithelial cells are detached from the matrix. These data provide important mechanistic information on the processes involved in sculpting the mammary gland and demonstrate that BIM is a critical regulator of apoptosis in vivo.