NEW YORK, Feb. 20 -- Wall Street managed a moderate advance in an uneven session Tuesday after a drop in oil prices and encouraging comments from a Federal Reserve official allowed investors to shrug off disappointment over declining sales at Home Depot.

The Dow rose 19.07, or 0.15 percent, to 12,786.64, after falling more than 60 points earlier. The Dow ended the day at its 31st record close since early October and its biggest five-day rally since mid-November. The Dow also reached a new trading high, 12,795.93.

The Standard & Poor's 500-stock index rose 4.14, or 0.28 percent, to 1459.68. The Nasdaq composite index rose 16.73, or 0.67 percent, to 2513.04.

Home Depot said sales at stores open at least a year dropped in the fourth quarter, suggesting that consumers were buying fewer home-improvement goods because of a sluggish housing market. Shares fell 10 cents, to $41.34.

The company's results sent the market down in early trading, but comments from outgoing Fed Governor Susan Bies, who said slumping demand for housing may have bottomed out, alleviated some concerns about the downturn dragging down the rest of the economy. Her remarks echoed those of Fed Chairman Ben S. Bernanke, who last week predicted that the economy will keep growing at a modest pace.

Oil prices, which fell $1.32, to $58.07 a barrel, on forecasts of warmer weather, also lent support to stocks. The decline in crude prices gave some investors reason to buy back into the market, as lower fuel costs curb consumer prices, which could help boost spending and reduce the chance of an interest rate increase.

Movers Wal-Martrose $1.80, to $50.28, after reporting fourth-quarter profit growth of 9.8 percent, which beat analyst estimates.

New River Pharmaceuticalsrose $4.84, to $63.19. Shire, a British pharmaceutical firm, plans to buy New River for about $2.6 billion.

Hewlett-Packardrose 36 cents, to $43.13. The computer maker said holiday sales drove its profit up in the latest quarter by 26 percent.

ConocoPhillips fell 57 cents, to $65.58.

Chevronfell 69 cents, to $70.12.

Exxon Mobilfell 42 cents, to $74.87.