Educational and income gradients in health are well established in the literature but there is need for a better understanding of how mental health inequalities change over time, and what drives the development. We aim to study how psychiatric diagnosis and its income-related inequality have changed over time in Sweden and to make a first attempt at disentangling the development by decomposing any changes in terms of changes in two important demographic characteristics: education and migration background. We use administrative patient data to study psychiatric inpatient diagnosis in the years 1994 and 2011. The study population comprises all individuals aged 31–64 years living in Sweden. Income-related inequalities are measured by the Concentration Index (CI). We decompose changes in the probability of receiving a diagnosis and changes in income-related inequality over time to understand the role of changing demographics. Our results show that over the study period the probability of receiving a psychiatric inpatient diagnosis increased by 12.6%, while the relative and absolute income-related inequalities in diagnosis increased by 48.2% and 66.7% respectively. In 2011, more than half of psychiatric inpatients were found among the poorest fifth of the population. The decomposition results suggest that changes in education and migration background have not played a substantial role in determining these increases. Education levels increased substantially over the study period which would be expected to protect against mental ill-health. Instead, we find that diagnoses have become more concentrated amongst the lowest educated individuals and the lowest income families, groups who appear to be increasingly disadvantaged. The growing proportion of individuals with foreign background in Sweden does, in fact, predict small increases in the probability of diagnosis, while the impact on diagnosis inequality varies depending on the definition of foreign background.