Background The decision to grant a disability pension is usually the end of a long process of medical examinations, treatment and rehabilitation attempts. This study investigates to what extent the time spent on rehabilitation time prior to disability pension is associated with characteristics of the individual or the local employment and welfare office, measured as municipality variance. Methods A study of 2,533 40 to 42 year olds who received disability pension over a period of 18 years. The logarithm of the rehabilitation time before granting a disability pension was analysed with multilevel regression. Results The rehabilitation time before a disability pension was granted ranged from 30 to 5,508 days. Baseline health characteristics were only moderately associated with rehabilitation time. Younger people and people with unemployment periods had longer rehabilitation time before a disability pension was granted. There were only minor differences in rehabilitation time between men and women and between different levels of education. Approximately 2% of the total variance in rehabilitation time could be attributed to the municipality of residence. Conclusions There is a higher threshold for granting a disability pension to younger persons and those who are expecting periods of unemployment, which is reflected in the extended rehabilitation requirements for these groups. The longer rehabilitation period for persons with psychiatric disorders might reflect a lack of common knowledge on the working capacity of and the fitted rehabilitation programs for people with psychiatric disorders.