A new study by the Opportunity and Growth Institute at the Minneapolis Fed found that the housing boom and bust made middle-class Americans poorer but boosted wealth for the richest 10%, widening the income and wealth gap substantially.

Authors of the paper examined the relationship between incomes and asset prices over the past 70 years, concluding that rising and falling housing and stock markets have been the main drivers of wealth inequality.

In the simplest model, the authors wrote, how fast wealth accumulates should be a function of how fast incomes rise. But incomes played only a minor role in wealth distributions in postwar America. Instead, wealth accumulation for most Americans was driven by booming home prices over the past several decade until 2007.

As seen in the chart above, real incomes of middle-class Americans rose by a third between 1970 and 2007, or less than 1% a year, while incomes of the bottom half have been largely stagnant since about 1970. Incomes for the top 10%, meanwhile, have doubled over the same period.

Incomes for the bottom 90% have stagnant over the past 10 years.

On the wealth distribution side, however, the poor became poorer, while the rich became richer after the financial crisis.

Up until 2007, middle class Americans saw their wealth increase at the same rate as their wealthy counterparts, rising 140% over 40 years. Incomes for households in the bottom half doubled from 1971 until 2007—all thanks to booming house prices.

Once the housing bubble burst, wealth quickly disappeared, leaving many homeowners in negative equity due to massive home loans.

The housing recovery has been painful, uneven and slow. By 2016, nearly a decade later, house prices were still 10% below their peak level, the paper said.

The stock market, however, recovered by 2013 and continued to climb to new peaks. The S&P SPX, +0.29% rose more than 366% from 2009 lows.

The wealth created by the real estate boom turned out to be illusionary. Ironically, paper gains from stocks continue to boost the wealth of households at the top of the distribution.

“This race between the equity market and the housing market shaped wealth dynamics in postwar America and decoupled the income and wealth distribution over extended periods,” the paper said.

“The historical data also reveal that no progress has been made in reducing income and wealth inequalities between black and white households over the past 70 years, and that close to half of all American households have less wealth today in real terms than the median household had in 1970,” the paper said.