The number of multimillion-dollar listings is suddenly dropping, and that is only making these pricey homes, well, pricier.

The supply shortage that has been plaguing the nation's housing market for the past two years has now affected the most expensive homes.

The top 5 percent of homes by price sold in the third quarter saw their values increase 4.9 percent compared with a year ago, hitting an average of $1.71 million, according to Redfin, a real estate brokerage.

The higher prices are the result of a sharp decline in listings in the luxury sector. The number of homes for sale priced at or above $1 million fell just over 18 percent compared with the same period last year.

"There is still strong buyer demand for high-end homes," said Redfin's chief economist, Nela Richardson. "Despite declining inventory, luxury sales soared in the third quarter."

Sales of homes priced at or above $1 million were up 11 percent from a year ago, while sales of homes priced at or above $5 million were up almost as much at 10 percent, Richardson explained.

At the ultra-high end, the number of homes priced at or above $5 million fell 19 percent. This marked the first quarter in which super luxury listings fell year over year since Redfin began reporting on the luxury market in 2014.

Given the high demand, supplies will likely continue to fall. Homebuilders are turning their attention to the lower end of the market, where demand has been rising for years and where the lack of supply is acute. The average price for nonluxury homes was $336,000 in the third quarter, up 5.3 percent compared with a year earlier.