Home Depot Inc reported a higher-than-expected quarterly profit on Tuesday and raised its full-year outlook as the world's largest home improvement chain benefited from a recent uptick in the U.S. housing market.

The nascent recovery in housing has encouraged professional contractors to buy more in recent months. Home Depot has also gained from its own efforts to improve distribution, cut costs and localize marketing and merchandising.

Shares of Home Depot were up 2 percent at $62.40 in trading before the market opened.

"Our third-quarter results were better than we expected and reflected, in part, what we believe is the start of the path toward the healing of the housing market," said Home Depot Chief Executive Officer Frank Blake.

Net earnings rose to $947 million, or 63 cents per share, in the third quarter ended on Oct. 28 from $934 million, or 60 cents per share, a year earlier.

Excluding a charge for closing seven stores in China, Home Depot said earnings were 74 cents per share. On that basis, analysts on average were expecting 70 cents, according to Thomson Reuters I/B/E/S.

Sales rose nearly 5 percent to $18.13 billion, topping analysts' estimates of $17.93 billion.

Sales at stores open at least a year increased 4.2 percent globally, including a 4.3 percent rise in the United States.

Home Depot has been taking market share from rival Lowe's Cos Inc with the help of better pricing and customer service, analysts have said. Lowe's, which has lagged Home Depot in same-store sales for 13 straight quarters, plans to report its results next week.

For the full year, Home Depot raised its sales growth forecast to 5.2 percent from 4.6 percent.

The company said it expected a fiscal-year profit of $3.03 a share, excluding the 11-cent charge. Its prior forecast, which it gave before news of the China closures, called for earnings of $2.95 per share.