Home Depot Inc. saw sales surge in the wake of this year’s barrage of hurricanes, but the storms still took a toll on the retailer’s bottom line.

Even as cleanup and rebuilding efforts helped the chain’s sales top analysts’ estimates, expenses related to the storms reduced operating profit by $51 million. Customers stocked up on less profitable plywood and generators during the natural disasters and that narrowed margins, the company said.

“Although natural disasters have had a positive impact on sales, their effect on margins has been less satisfactory,” said Neil Saunders, a GlobalData Retail analyst

The shares rose 1.6 percent to $168.06 on Tuesday. They had been up 23 percent this year through Monday’s close.

The good news is Home Depot continued to benefit from the rebound in housing prices, which spurs owners to spend more on fixing up their properties. Last quarter, values in 92 percent of U.S. metro areas rose.

Revenue climbed 8.1 percent to $25 billion, compared with analysts’ average estimate of $24.5 billion. Profit rose to $1.84 a share, exceeding the average $1.82 projection. That marked the 14th straight quarter Home Depot has surpassed projections.

Sales at stores open for more than a year — a key benchmark for investors — rose 7.9 percent, more than two percentage points above estimates, according to Consensus Metrix.

Home Depot said the hurricanes lifted same-store sales by about $282 million in the quarter, and those gains are expected to surge in the final months of the year because that’s when homeowners will start receiving insurance checks for damage, the company said.

The company lifted its guidance for the full year, saying sales will be up about 6.3 percent. That’s a full percentage point above previous projections. Profit will be about $7.36 a share, above the previous forecast of $7.29 a share, Home Depot said.

The company added it doesn’t expect a tax proposal from House Republicans to have a material impact on results.

The bill would lower the deduction cap for mortgages to $500,000 from $1 million. Only 22 percent of tax filers use the deduction and about 5 percent of mortgages are in excess of $500,000, the company said.

Provisions in the House and Senate tax bill won’t slow the U.S. housing market, according to Chief Financial Officer Carol Tome.

Aggregate prices are still below where they were before the recession while the company sees more millennials forming families and boosting demand. The company expects home values to keep rising for at least the next three years.

“The rumors of an impending slowdown, we don’t see it,” Tome said in a call with analysts. “We look at the underlying data. We look at what happens in our stores every day, and on our website, and we just don’t see it.”