Recent clinical and experimental studies have highlighted a complex role for the immune system in the pathophysiological changes that occur after acute stroke. Sensors of the innate immune system such as Toll-like receptors, or effectors such as the lectin pathway of complement activation and innate immune cells, are activated by brain ischaemia and tissue damage, leading to amplification of the inflammatory cascade. Activation of the adaptive arm of the immune system, mediated by lymphocyte populations including T and B cells, regulatory T cells, and γδT cells, in response to stroke can lead to deleterious antigen-specific autoreactive responses but can also have cytoprotective effects. Increased incidence of infections is observed after acute stroke, and might result from activation of long-distance feedback loops between the CNS and peripheral immune organs, which are thought to play a part in stroke-induced immunodepression. Ongoing clinical trials are investigating whether the preventive use of antibiotics improves functional outcome after stroke. This Review discusses the multifaceted role of the immune system in the pathophysiology of acute stroke.