Sales of previously owned U.S. homes rose in October at a faster-than-expected pace to the highest in more than 2-1/2 years as buyers rushed to take advantage of a popular tax credit, a survey showed on Monday.

The National Association of Realtors said sales surged a record 10.1 percent month-over-month to an annual rate of 6.10 million units, the highest since February 2007, from a downwardly revised 5.54 million-unit pace in September.

Analysts polled by Reuters had expected October sales to jump to a 5.70 million-unit pace from the previously reported 5.57 million units in September. Compared to October last year, home sales were up by a record 23.5 percent.

U.S. stock indexes extended gains on the data, while Treasury debt prices were little changed.

Many buyers have been rushing to beat the deadline for first-time buyer credit that was scheduled to expire at the end of this month, and similarly robust sales may be occurring in November, said Lawrence Yun, NAR's chief economist.

Distressed transactions accounted for 30 percent of sales last month and continued to weigh on house prices. First-time buyers made up a third of sales in October.

The national median home price fell 7.1 percent from October last year, the smallest decline in over a year, to $173,100. Homes in foreclosure typically sell for 15 to 20 percent less than traditional homes.

Existing home sales have already bottomed. Home prices are almost there. We are seeing a less of a decline in house values, said Yun.

The housing market is slowly mending after a three-year decline, which contributed to tipping the U.S. economy into its worst recession in seven decades. Housing construction contributed to economic growth in the third quarter for the first time since 2005.

Recovery is being supported by the $8,000 tax credit for first-time buyers, low mortgage rates and falling house prices. The government this month extended the incentive into next year and added a $6,500 credit for home owners buying a new residence. It had been due to expire on November 30.

The tax benefits going into the housing market are working, and that's a relief, said William Larkin, portfolio manager at Cabot Money Management in Boston. Everything is about housing and jobs right now.

The improvement in October sales was broad-based, with sales of single-family homes, the biggest segment of the market, rising 9.7 percent to an annual rate of 5.33 million units, while condominium and co-ops increased 13.2 percent to a 770,000-unit rate.

Sales were up in all four regions of the country. Prices rose 1.1 percent in the Midwest, which didn't see the same boom as the rest of the country, while declining in the other three. The rise in the Midwest was the first price increase in any region since November 2008.

Analysts are cautiously hoping a sustained housing market recovery will help to improve the psychology of households, which has been shaken by rising unemployment.

While the economy resumed growing in the July-September period after four quarters of decline, sluggish consumer spending is seen slowing the momentum.

The inventory of existing homes for sale in October fell 3.7 percent to 3.57 million units from the previous month, NAR said. At October's sales pace, that represented a supply of 7.0 months, the lowest in 2-1/2 years, from September's revised 8.0 months.

(Additional reporting by Corbett B. Daly; Editing by Padraic Cassidy)