Carbon monoxide-generating heme oxygenase-2 is expressed in neurons and plays a crucial role for regulating hypoxic vasodilation through mechanisms unlocking carbon monoxide-dependent inhibition of H2S-generating cystathionine β-synthase expressed in astrocytes. This study aims to examine whether heme oxygenase-2 plays a protective role in mice against stroke. Focal ischemia was induced by middle cerebral artery occlusion. Regional differences in metabolites among ipsilateral and contralateral hemispheres were analysed by quantitative imaging mass spectrometry equipped with an image-processing platform to optimize comparison of local metabolite contents among different animals. Under normoxia, blood flow velocity in precapillary arterioles were significantly elevated in heme oxygenase-2-null mice vs controls, while metabolic intermediates of central carbon metabolism and glutamate synthesis were elevated in the brain of heme oxygenase-2-null mice, suggesting greater metabolic demands to induce hyperemia in these mice. In response to focal ischemia, heme oxygenase-2-null mice exhibited greater regions of ischemic core that coincide with notable decreases in energy metabolism in the contralateral hemisphere as well as in penumbra. In conclusion, these findings suggest that heme oxygenase-2 is involved in mechanisms by which not only protects against compromised energy metabolism of the ipsilateral hemisphere but also ameliorates transhemispheric diaschisis of the contralateral hemisphere in ischemic brain.