Nations are imposing unprecedented measures at a large scale to contain the spread of the COVID-19 pandemic. While recent studies show that non-pharmaceutical intervention measures such as lockdowns may have mitigated the spread of COVID-19, those measures also lead to substantial economic and social costs, and might limit exposure to ultraviolet-B radiation (UVB). Emerging observational evidence indicates the protective role of UVB and vitamin D in reducing the severity and mortality of COVID-19 deaths. This observational study empirically outlines the protective roles of lockdown and UVB exposure as measured by the ultraviolet index (UVI). Specifically, we examine whether the severity of lockdown is associated with a reduction in the protective role of UVB exposure. We use a log-linear fixed-effects model on a panel dataset of secondary data of 155 countries from 22 January 2020 until 7 October 2020 (n = 29,327). We use the cumulative number of COVID-19 deaths as the dependent variable and isolate the mitigating influence of lockdown severity on the association between UVI and growth rates of COVID-19 deaths from time-constant country-specific and time-varying country-specific potentially confounding factors. After controlling for time-constant and time-varying factors, we find that a unit increase in UVI and lockdown severity are independently associated with − 0.85 percentage points (p.p) and − 4.7 p.p decline in COVID-19 deaths growth rate, indicating their respective protective roles. The change of UVI over time is typically large (e.g., on average, UVI in New York City increases up to 6 units between January until June), indicating that the protective role of UVI might be substantial. However, the widely utilized and least severe lockdown (governmental recommendation to not leave the house) is associated with the mitigation of the protective role of UVI by 81% (0.76 p.p), which indicates a downside risk associated with its widespread use. We find that lockdown severity and UVI are independently associated with a slowdown in the daily growth rates of cumulative COVID-19 deaths. However, we find evidence that an increase in lockdown severity is associated with significant mitigation in the protective role of UVI in reducing COVID-19 deaths. Our results suggest that lockdowns in conjunction with adequate exposure to UVB radiation might have even reduced the number of COVID-19 deaths more strongly than lockdowns alone. For example, we estimate that there would be 11% fewer deaths on average with sufficient UVB exposure during the period people were recommended not to leave their house. Therefore, our study outlines the importance of considering UVB exposure, especially while implementing lockdowns, and could inspire further clinical studies that may support policy decision-making in countries imposing such measures.