Buying a home is getting more and more expensive, thanks to sharp increases in both prices and mortgage rates. That is juicing demand for apartment rentals and, in turn, pushing rents higher.

Rents in the third quarter of this year were up 2.9 percent compared with a year ago, according to RealPage, a real estate analytics firm. That's up from 2.5 percent annual growth in the second quarter. Rent growth had been slowing for the past three years, thanks to a big increase in supply of new rental units. The reversal in rents, however, may be short-lived.

"Momentum in the apartment market's performance during the third quarter slightly surpassed expectations," according to RealPage's chief economist Greg Willett. "Still, there doesn't seem to be a pronounced shift in the big-picture story. We are about to move into the period of seasonally slow apartment leasing that comes with the cold weather months."

Apartment demand is being strengthened by an improving economy, as well as a shortage of affordable homes for sale. New household formations are rising, and renter households represent nearly a third of occupied housing, according to the U.S. Census.

"The apartment market had slowed at the end of 2017 and early 2018 as the housing market started to accelerate. However, the passing of the Tax Reform and Jobs Act in December that doubled the standard deduction and cut the deductibility of state and local taxes reduced the incentive to buy a home. This has helped the apartment market, especially in high-taxed localities," according to Barbara Denham, senior economist at Reis, a commercial real estate information company.

The apartment occupancy rate is quite high at 95.8 percent, up from 95.4 percent in the second quarter. Demand, however, will likely trail completions of new units in the coming months, which will throw cold water on the current heat in rent growth.

Apartment construction continues to be robust. New multifamily starts were up 37 percent annually in August, according to the U.S. Census. While that number is pretty volatile month to month, market-rate apartment completions have totaled between 300,000 and 325,000 units annually for the past two years. With continued robust construction, volume should remain at that rate through the end of next year.

High-end apartment rents, however, are still under pressure, as construction of luxury units far outpaces demand.

"With so much high-end new product finishing in the near term, the leasing environment will be competitive in that luxury apartment niche," according to Willett. "At the same time, product shortages remain for moderately priced rental housing. It's tough to find available apartments at the middle to lower-end price points across most neighborhoods."

Of course all real estate is local, and some markets are seeing much bigger rent increases. Leaders include Las Vegas, Orlando, Florida, and Phoenix, where rents are up between 6 and 7 percent over the past year. Rents also jumped more than 4 percent in Jacksonville, Florida, San Jose, California, Tampa, Florida, Riverside, California, Salt Lake City and San Diego.

The San Francisco Bay Area had seen rents shrinking throughout 2016-2017, but they are increasing once again. Rent laggards include St. Louis, Baltimore, Dallas and Seattle, where growth is less than 2 percent.

WATCH: Renting vs. buying a home - here are the numbers you need to decide