Spreading depolarization is assumed to be the mechanism of migraine with aura, which is accompanied by an initial predominant hyperaemic response followed by persistent vasoconstriction. Cerebral blood flow responses are impaired in patients and in experimental animals after spreading depolarization. Understanding the regulation of cortical blood vessels during and after spreading depolarization could help patients with migraine attacks, but our knowledge of these vascular mechanisms is still incomplete. Recent findings show that control of cerebral blood flow does not only occur at the arteriole level but also at capillaries. Pericytes are vascular mural cells that can constrict or relax around capillaries, mediating local cerebral blood flow control. They participate in the constriction observed during brain ischaemia and might be involved the disruption of the microcirculation during spreading depolarization. To further understand the regulation of cerebral blood flow in spreading depolarization, we examined penetrating arterioles and capillaries with respect to vascular branching order, pericyte location and pericyte calcium responses during somatosensory stimulation and spreading depolarization. Mice expressing a red fluorescent indicator and intravenous injections of FITC-dextran were used to visualize pericytes and vessels, respectively, under two-photon microscopy. By engineering a genetically encoded calcium indicator we could record calcium changes in both pericytes around capillaries and vascular smooth muscle cells around arterioles. We show that somatosensory stimulation evoked a decrease in cytosolic calcium in pericytes located on dilating capillaries, up to the second order capillaries. Furthermore, we show that prolonged vasoconstriction following spreading depolarization is strongest in first order capillaries, with a persistent increase in pericyte calcium. We suggest that the persistence of the 'spreading cortical oligaemia' in migraine could be caused by this constriction of cortical capillaries. After spreading depolarization, somatosensory stimulation no longer evoked changes in capillary diameter and pericyte calcium. Thus, calcium changes in pericytes located on first order capillaries may be a key determinant in local blood flow control and a novel vascular mechanism in migraine. We suggest that prevention or treatment of capillary constriction in migraine with aura, which is an independent risk factor for stroke, may be clinically useful.