Sales of previously owned homes fell for a third straight month in February and the supply of unsold houses on the market surged, showing the housing market was struggling to find its feet.

Existing home sales dipped 0.6 percent month-over-month to an annual rate of 5.02 million units, the National Association of Realtors said on Tuesday. The drop last month was a touch less than market expectations for a fall to 5.0 million units.

The data showed weakness at a crucial time for the housing market with the Federal Reserve due to wind up its program to buy mortgage-related securities. The program pushed home loan rates to record lows and helped the market slowly recover from a three-year slump.

Analysts were disturbed by the first rise in inventories in seven months and the jump in the months' worth of supply to its highest level since August.

It says to me not to expect significant price gains in the near term. We are looking at flat house prices this year on average, not every month, part of it is this overhang of supply, said Craig Thomas, senior economist at PNC Financial Services in Pittsburgh.

U.S. stocks ignored the rise in inventories, surging on relief that the drop in sales was less than forecast. Both the Dow Jones industrial average <.DJI> and the Standard & Poor's 500 Index <.SPX> jumped to 18-month closing highs.

Home sales surged from September to November on the back of an $8,000 tax credit for first-time buyers. Even though the tax credit was extended and expanded, sales have remained subdued, raising worries of a relapse in a sector that was the main trigger of the worst U.S. recession since the 1930s.

Analysts believe home purchases were pushed forward to take advantage of the tax credit that had been originally scheduled to end last November. Some doubted a last minute surge in sales would materialize as buyers try to beat the April deadline to sign contracts and close them by June.

MINIMAL HELP FROM TAX CREDIT

The key question remains whether the second home-buyers tax credit will boost sales. So far, the housing recovery is very slow, and the second tax credit appears to be having a minimal effect, said Gregory Daco, a U.S. economist at IHS Global Insight in Lexington, Massachusetts.

Treasury Secretary Timothy Geithner said on Tuesday the government -- which has lent support to the housing market -- should continue to play a role in any new system of housing finance Congress develops.

Underscoring the fragility of the housing recovery, one of the country's top five homebuilders KB Home posted a wider-than-expected loss in the first-quarter ended February 28 as prices and demand for its houses sagged.

With sales dropping again last month, the inventory of existing homes for sale jumped 9.5 percent to 3.59 million units. That represented 8.6 months' worth of supply -- the highest since August. The NAR blamed the surge in inventories to a wave of distressed properties flooding the market.

The rise in the supply of homes on the market pushed the national median home price down 1.8 percent from February last year to $165,100.

A separate report from the U.S. Federal Housing Finance Agency showed house prices fell 0.6 percent month-on-month in January. They fell 3.3 percent in the 12 months to January.

The end of the tax credit and the Fed's purchases of mortgaged-backed securities (MBS) meant housing would continue to struggle into the second half of this year, analysts said.

This data points to a very rough second half of the year in the housing market that will feature another round of price declines for homeowners in many areas of the country, said Joseph Brusuelas, chief economist at Brusuelas Analytics in Stamford, Connecticut.

While the Fed is ending its MBS purchasing program, it remains committed to keeping benchmark interest rates ultra low for a while, a position that was reiterated on Tuesday by San Francisco Federal Reserve President Janet Yellen.

Such an accommodative policy is currently appropriate, in my view, because the economy is operating well below its potential and inflation is subdued. I don't believe this is yet the time to be tightening monetary policy, Yellen said.

The decline in February sales was concentrated in single-family homes -- the biggest portion the market -- which fell 1.4 percent. Condominium and co-ops rose 4.8 percent.

Last month, distressed transactions accounted for 35 percent of sales and continued to weigh on house prices, the NAR said. First-time buyers made up 42 percent of sales, with cash purchases accounting for 26 percent.

(Additional reporting by Ann Saphir, Editing by Chizu Nomiyama)