Although studies have shown associations between neighbourhood quality and chronic disease outcomes, such associations are potentially confounded by the selection of different types of people into different neighbourhood environments. We sought to identify the causal effects of neighbourhood deprivation on type 2 diabetes risk, by comparing refugees in Sweden who were actively dispersed by government policy to low-deprivation, moderate-deprivation, or high-deprivation neighbourhoods.In this quasi-experimental study, we analysed national register data for refugees who arrived in Sweden aged 25-50 years, at a time when the government policy involved quasi-random dispersal of refugees to neighbourhoods with different levels of poverty and unemployment, schooling, and social welfare participation. Individuals in our sample were assigned to a neighbourhood categorised as high deprivation (≥1 SD above the mean), moderate deprivation (within 1 SD of the mean), or low deprivation (≥1 SD below the mean). The primary outcome was new diagnosis of type 2 diabetes between Jan 1, 2002, and Dec 31, 2010. We used multivariate logistic and linear regressions to assess the effects of neighbourhood deprivation on diabetes risk, controlling for potential confounders affecting neighbourhood assignment and assessing effects of cumulative exposure to different neighbourhood conditions.We included data for 61 386 refugees who arrived in Sweden during 1987-91 and who were assigned to one of 4833 neighbourhoods. Being assigned to an area deemed high deprivation versus low deprivation was associated with an increased risk of diabetes (odds ratio [OR] 1·22, 95% CI 1·07-1·38; p=0·001). In analyses that included fixed effects for assigned municipality, the increased diabetes risk was estimated to be 0·85 percentage points (95% CI -0·030 to 1·728; p=0·058). Neighbourhood effects grew over time such that 5 years of additional exposure to high-deprivation versus low-deprivation neighbourhoods was associated with a 9% increase in diabetes risk.This study makes use of a pre-existing governmental natural experiment to show that neighbourhood deprivation increased the risk of diabetes in refugees in Sweden. This finding has heightened importance in the context of the current refugee crisis in Europe.US National Heart, Lung, and Blood Institute, US National Center for Advancing Translational Sciences, US National Institute on Minority Health and Health Disparities, Swedish Research Council.