Prestroke physical activity may protect the brain from severe consequences of stroke. However, previous studies on this subject included mainly ischemic stroke cases, and the association between prestroke physical activity and outcomes after intracerebral hemorrhage is uncertain. Therefore, we sought to examine the associations between prestroke physical activity, stroke severity, and all-cause mortality after intracerebral hemorrhage in comparison with ischemic stroke. This was a longitudinal, register-based cohort study. All adult patients with intracerebral hemorrhage or ischemic stroke admitted to 3 stroke units in Gothenburg, Sweden, between November 1, 2014, and June 30, 2019, were screened for inclusion. Physical activity was defined as light physical activity ≥4 h/wk or moderate physical activity ≥2 h/wk the year before stroke. Stroke severity was assessed on admission using the NIH Stroke Scale. All-cause mortality rates were followed up to 7 years, from the time of incident stroke until death or censoring. Ordinal logit models and Cox proportional hazards models were used to estimate adjusted associations of prestroke physical activity. We included 763 patients with intracerebral hemorrhage and 4,425 with ischemic stroke. Prestroke physical activity was associated with less severe strokes by an adjusted odds ratio of 3.57 (99% CI 2.35-5.47) for intracerebral hemorrhages and 1.92 (99% CI 1.59-2.33) for ischemic strokes. During a median follow-up of 4.7 (interquartile range 3.5-5.9) years, 48.5% of patients with intracerebral hemorrhage died, compared with 37.5% with ischemic stroke. Prestroke physical activity was associated with decreased short-term mortality (0-30 days) by an adjusted hazard ratio of 0.30 (99% CI 0.17-0.54) after intracerebral hemorrhage and 0.22 (99% CI 0.13-0.37) after ischemic stroke. Prestroke physical activity was further associated with decreased long-term mortality (30 days-2 years) by an adjusted hazard ratio of 0.40 (99% CI 0.21-0.77) after intracerebral hemorrhage and 0.49 (99% CI 0.38-0.62) after ischemic stroke. Prestroke physical activity was associated with decreased stroke severity and all-cause mortality after intracerebral hemorrhage and ischemic stroke, independent of other risk factors. Based on current knowledge, health care professionals should promote physical activity as part of primary stroke prevention.