Home prices increased in the third quarter due to the continued low levels of housing inventory, keeping many potential homebuyers out of the housing market.

The national median existing single-family home price increased 4.8% annually to $266,900 in the third quarter, according to the latest quarterly report from the National Association of Realtors. This is a slightly slowdown from the annual increase of 4.9% in the second quarter this year.

Home prices increased all across the country, rising in 93% of measured markets in the third quarter, or 166 out of 177 metropolitan areas. About 10% of metros, 18 areas, even saw price increases in the double digits. This is down from 24% of metros in the second quarter.

“Though inventory is more than adequate on the upper-end market, the insufficient supply of low to mid-priced homes in metro markets with strong job growth continues to drive up prices and push prospective buyers out of the market,” NAR Chief Economist Lawrence Yun said.

Total existing home sales, including singly-family homes and condos, decreased 2.6% from a seasonally adjusted annual rate of 5.41 million sales in the second quarter to 5.27 million in the third quarter. This is also down 2.4% from 5.4 million sales in the third quarter of 2017.

“A strong economy and consistent job growth should be driving up home sales; however, would-be homebuyers are struggling to find a home they can afford,” Yun said. “As mortgage rates continue to rise, reaching the decade’s highest rates this quarter, an increase in the supply of affordable homes has become even more important to help temper price growth across the country.”

But while the housing market continues to struggle for lack of inventory, it has improved since last year. NAR’s report shows that at the end of the third quarter, there were 1.88 million existing homes available for sale. This is 1.1% higher than the 1.86 million homes for sale at the end of the third quarter of 2017. The average supply of homes was 4.3 months during the third quarter, up from 4.2 months last year.

National family median income increased to $76,608 in the third quarter, but due to rising home prices and mortgage rates, affordability is down. In order to buy a single-family home at the national median price, a buyer making a 5% down payment would need an income of $64,480. A buyer making a 10% down payment would need an income of $61,086 and for a 20% down payment a buyer needs to make $54,299.

“Aspiring middle-class home buyers continue to face affordably issues, as buyers are increasingly being priced out in the West while the rest of the country struggles, too,” Yun said. “The market desperately needs homebuilders to begin constructing more moderately priced single-family home and condominiums to help satisfy demand and mitigate rapid price growth.”

Home prices are especially high in the Western U.S., with California taking four of the top five most expensive metros. The most expensive housing markets in the third quarter included San Jose, California, where the median home price was $1.3 million; San Francisco-Oakland-Hayward, California, with $989,000; Anaheim-Santa Ana-Irvine, California, with $830,000; urban Honolulu with $818,600 and San Diego-Calsbad, California with $650,000.