Housing affordability hit its worst level in nearly a decade during the first quarter, according to Attom Data Solutions.

Attom measures affordability by comparing average wages to median home prices to determine the share of income people need to spend on housing.

Prospective buyers needed to shell out more because mortgage rates rose. The pace of home-price growth actually slowed, according to Attom.

Housing in the US has not been this unaffordable since property values were in free fall 10 years ago.

In the first quarter, affordability as measured by the average share of income needed to buy a median-priced house was at its worst since the third quarter of 2008, according to Attom Data Solutions. The firm's affordability index fell to 95, the lowest since it read at 86 nearly a decade ago.

This was not just because home prices were too high. In fact, the rate of appreciation slowed in the first quarter, according to Attom.

What really tipped the scale was the rise in mortgage rates, said Daren Blomquist, the senior vice president at Attom, in a report. Mortgage rates hit their highest level in seven years last month, and the national average 30-year fixed rate is now above 4.4%, according to Bankrate.com. A year ago, it was 3.8%.

And so, mortgage rates are up along with prices. Wages are rising, too, but not yet quickly enough to move the needle on affordability.

"Home-price appreciation continued to outpace wage growth, speeding up the affordability treadmill for prospective homebuyers even without the rise in mortgage rates," Blomquist said.

The recovery in home prices has been great for homeowners who lost value in the financial crisis. But unlike prices, homebuilding hasn't yet returned to precrisis levels, leading to a limited inventory of affordable houses. In some major cities including New York, developers have overbuilt in the luxury end of the market where it's more lucrative.

The median-priced home was unaffordable for people earning the average wage in 75% of US counties, Attom said. In San Francisco's Marin County, where affordability was worst, the average wage earner would have needed 133% of his or her income to buy a median-priced home. In Michigan's Wayne County, which includes Detroit, it was 14%.

The reason affordability worsened so much — higher mortgage rates — is a mixed bag in terms of what it means for the housing market.

That's because the decision to buy a home is not influenced solely by the level of interest rates. Buying a home is about more than just making an investment — for some it can be about fulfilling a lifelong dream, putting down roots, and leaving something tangible for future generations. And so, a few hundred dollars extra every month is unlikely to deter many first-time shoppers who have found their dream home.

Data compiled by Ellie Mae confirms this. The mortgage-software provider's most recent numbers, for May, showed that the share of loans taken out for buying homes (not for mortgage refinancing) hit a high not seen since record keeping began in 2011. Refinancing, however, has been on the decline, falling to a 17-year low in May as borrowing costs increased.

"While inventories remain tight, we're seeing an increasing percentage of purchase loans," said Jonathan Corr, the president and CEO of Ellie Mae.