Vascular endothelial cells in the central nervous system (CNS) form a barrier that restricts the movement of molecules and ions between the blood and the brain. This blood-brain barrier (BBB) is crucial to ensure proper neuronal function and protect the CNS from injury and disease. Transplantation studies have demonstrated that the BBB is not intrinsic to the endothelial cells, but is induced by interactions with the neural cells. Owing to the close spatial relationship between astrocytes and endothelial cells, it has been hypothesized that astrocytes induce this critical barrier postnatally, but the timing of BBB formation has been controversial. Here we demonstrate that the barrier is formed during embryogenesis as endothelial cells invade the CNS and pericytes are recruited to the nascent vessels, over a week before astrocyte generation. Analysing mice with null and hypomorphic alleles of Pdgfrb, which have defects in pericyte generation, we demonstrate that pericytes are necessary for the formation of the BBB, and that absolute pericyte coverage determines relative vascular permeability. We demonstrate that pericytes regulate functional aspects of the BBB, including the formation of tight junctions and vesicle trafficking in CNS endothelial cells. Pericytes do not induce BBB-specific gene expression in CNS endothelial cells, but inhibit the expression of molecules that increase vascular permeability and CNS immune cell infiltration. These data indicate that pericyte-endothelial cell interactions are critical to regulate the BBB during development, and disruption of these interactions may lead to BBB dysfunction and neuroinflammation during CNS injury and disease.