Pending home sales in January rose 5.2%, the National Association of Realtors said Thursday, crushing analysts' expectations of a 2% monthly gain. They were 5.7% higher on an annual basis.

"This month's solid activity — the second-highest monthly figure in over two years — is due to the good economic backdrop and exceptionally low mortgage rates," said Lawrence Yun, NAR's chief economist.

Pending sales measure signed contracts, not closings, so they are an indicator of future closings two to three months out.

Very low mortgage rates should be juicing sales more, but the existing home market is struggling with a record low supply of homes for sale, the lowest since 1999. Investors turned about 5 million homes into single-family rentals during the foreclosure crisis, and they continue to be active in the market, as rents are quite favorable.

"Inventory availability will be the key to consistent future gains," Yun said. "Moreover, the latest stock market correction could provide exceptional, even lower mortgage rates for a few weeks, and that would help bring about a noticeable upturn in the coming months."

Regionally, pending home sales in the Northeast rose 1.3% monthly and were 1.2% higher than a year earlier. In the Midwest, sales increased 7.3% for the month and were 6.5% higher than in January 2019.

Pending home sales in the South grew 8.7% monthly and 7.1% annually. The West was the only region to see a decline for the month, down 1.1%, but sales were still 5.5% higher annually.

"What happens from here though is anyone's guess, with the sharp drop in mortgage rates on one hand, and the economic repercussions—including the drop in the stock market which effects everyone's psyche—on the other," said Peter Boockvar, chief investment officer at Bleakley Advisory Group and a CNBC contributor.

Sales of newly built homes, which are also measured by signed contracts, jumped to the highest level in January since 2007, according to the U.S. Census. Builders are increasing production slowly, but they have still not reached even normal historical levels since the recession. Builders are also starting to increase production of lower-priced homes, but they continue to be hindered by high costs for land, labor and materials.