Fibroblasts and immune cells coordinate tissue regeneration and necessary scarring after injury. In the brain, fibroblasts are border-enriched cells whose dynamic molecular states and immune interactions after injury remain unclear1. Here we define the shared fibroblast–immune response to brain injury. Early profibrotic myofibroblasts develop from pre-existing brain fibroblasts and infiltrate brain lesions, orchestrated by fibroblast TGFβ signalling, profibrotic macrophages and microglia, and perilesional glia. Myofibroblasts transition into several late fibroblast states, including lymphocyte-interactive fibroblasts. Interruption of the early myofibroblast state exacerbated sub-acute brain injury, tissue loss and secondary neuroinflammation, with increased mortality in the transient middle cerebral artery occlusion stroke model. Disruption of late lymphocyte–fibroblast niches via selective loss of fibroblast chemokine CXCL12 led to late brain-specific innate inflammation and lymphocyte dispersal with increased IFNγ production. These data indicate the response to brain injury is coordinated by evolving temporal and spatial fibroblast states that limit functional tissue loss and chronic neuroinflammation.