The mechanism that controls the passage of substances from the blood to the cerebrospinal fluid bathing the brain and spinal cord. It resides in the special properties of the blood capillaries that supply the central nervous system, the walls of which act like a semipermeable membrane, permitting the passage of solutions but excluding particles and large molecules, including potentially noxious substances. This barrier provides the central nervous system (CNS) with a constant environment, while not interfering with the transport of essential metabolites. But it is also a constraint on the effective delivery of drugs to the CNS. However, any breakdown in the blood-brain barrier, e.g. due to a stroke or trauma, is a major factor in the pathology of such diseases. See also glia.