Brain precapillary sphincters, which are surrounded by contractile pericytes and are located at the junction of penetrating arterioles and first-order capillaries, can increase their diameter by ~30% in a few seconds during sensory stimulation, allowing for rapid control of capillary blood flow over a wide dynamic range. We hypothesized that these properties could help precapillary sphincters maintain the capillary blood flow and shield the downstream capillaries during surges in blood pressure. To test this, we visualized microvessels in adult and old anaesthetized mice using in vivo two-photon microscopy. We showed that a blood pressure surge disrupts both microvascular myogenic response and neurovascular coupling in both adult and old mice, with old mice exhibiting a more diminished myogenic response. Similarly, laser ablation of contractile pericytes encircling precapillary sphincters disrupted neurovascular coupling and myogenic response. The resistance provided by precapillary sphincters may be increasingly important in old mice, where we found changes in the topology of microvessels, potentially affecting microvascular blood flow. Old mice displayed more tortuous penetrating arterioles, reduced pial collateral arteriolar density and altered capillary densities: reduced in the arterial end and increased in the venous end. Our results illustrate how blood pressure surges affect brain microvascular function, underscore the protective role of precapillary sphincters during cerebrovascular autoregulation in response to blood pressure surges and compare vascular topology in adult and old mice in vivo.