Evidence for the association between vitamin D and risk of recurrent stroke remains sparse and limited. We aimed to assess the relationship between serum circulating 25-hydroxyvitamin D (25(OH)D) level and risk of recurrent stroke in patients with a stroke history, and to identify the optimal 25(OH)D level in relation to lowest recurrent stroke risk. Data from the nationwide prospective United Kingdom Biobank were used for analyses. Primary outcome was time to first stroke recurrence requiring a hospital visit during follow-up. We used Cox proportional hazards regression model with restricted cubic splines to explore 25(OH)D level in relation to recurrent stroke. The dose-response relationship between 25(OH)D and recurrent stroke risk was also estimated, taking the level of 10 nmol/L as reference. A total of 6824 participants (mean age: 60.6 years, 40.8% females) with a baseline stroke were included for analyses. There were 388 (5.7%) recurrent stroke events documented during a mean follow-up of 7.6 years. Using Cox proportional hazards regression model with restricted cubic splines, a quasi J-shaped relationship between 25(OH)D and risk of recurrent stroke was found, where the lowest recurrent stroke risk lay at the 25(OH)D level of approximate 60 nmol/L. When compared with 10 nmol/L, a 25(OH)D level of 60 nmol/L was related with a 48% reduction in the recurrent stroke risk (hazard ratio = 0.52, 95% confidence interval: 0.33–0.83). Based on data from a large-scale prospective cohort, we found a quasi J-shaped relationship between 25(OH)D and risk of recurrent stroke in patients with a stroke history. Given a lack of exploring the cause–effect relationship in this observational study, more high-quality evidence is needed to further clarify the vitamin D status in relation to recurrent stroke risk.