WASHINGTON, Feb 22 (Reuters) - U.S. existing home sales increased to a five-month high in January as declining mortgage rates pulled in buyers from the sidelines, but tight supply remains a challenge.

Home sales rose 3.1% last month to a seasonally adjusted annual rate of 4.00 million units, the highest level since last August, the National Association of Realtors said on Thursday. The Realtors' group revised the data for the past three years.

Economists polled by Reuters had forecast home resales rising to a rate of 3.97 million units.

Home resales are counted at the closing of a contract. The sales in January likely reflected contracts signed in the prior two months. The average rate on the popular 30-year fixed mortgage dropped to 6.61% at the end of December from 7.79% in late October, which was the highest since 2000, according to data from mortgage finance agency Freddie Mac.

Sales rose in the densely populated South and the Midwest, which is considered the most affordable region, as well as in the West. They were unchanged in the Northeast.

Home resales, which account for a large portion of U.S. housing sales, declined 1.7% year-on-year in January.

"Listings were modestly higher, and home buyers are taking advantage of lower mortgage rates compared to late last year," said Lawrence Yun, the NAR's chief economist.

There were 1.01 million previously owned homes on the market in January, up 3.1% from a year ago, but still below the nearly 2 million units before the COVID-19 pandemic. At January's sales pace, it would take 3.0 months to exhaust the current inventory of existing homes, up from 2.9 months a year ago.

A four-to-seven-month supply is viewed as a healthy balance between supply and demand. With supply still tight, the median existing home price increased 5.1% from a year earlier to $379,100 in January, the highest on record for any January. Home prices increased in all four regions.

"Multiple offers are common on mid-priced homes, and many homes were still sold within a month," said Yun.

Properties typically stayed on the market for 36 days in January, up from 33 days a year ago.

First-time buyers accounted for 28% of sales, compared to 31% a year ago. That share is well below the 40% that economists and realtors say is needed for a robust housing market. All-cash sales made up 32% of transactions. That was the largest share since June 2014 and was up from 29% a year ago.

Distressed sales, including foreclosures, represented only 2% of transactions, virtually unchanged from last year. (Reporting by Lucia Mutikani; Editing by Andrea Ricci)