Despite pockets of turbulence in the U.S. economy, Home Depot (HD) on Tuesday logged a stronger-than-expected 12% rise in second-quarter profits and upgraded its full-year guidance.

Shares of the world’s largest home improvement retailer gained almost 2% in response even as sales rose less than Wall Street had been banking on.

Atlanta-based Home Depot said it earned $1.53 billion, or $1.01 a share, last quarter, compared with a profit of $1.36 billion, or 86 cents a share, a year earlier. Analysts had been calling for EPS of 97 cents.

Sales inched up 1.7% to $20.57 billion, narrowly trailing the Street’s view of $20.74 billion. Same-store sales increased 2.1% overall and 2.6% in the U.S. Gross margins ticked up to 34.2% from 34%.

Home Depot said customer transactions grew just 0.6%, but the average ticked jumped 1.8% to $55.02.

“Second-quarter sales reflected the pull forward of seasonal activity into the first quarter,” CEO Frank Blake said in a statement. “But we saw continued demand for core products and delivered second-quarter earnings above our expectations."

Thanks in part to stock buybacks, Home Depot hiked its 2012 EPS target to $2.95, up from $2.90 previously. Analysts had been calling for full-year EPS of $2.39.

Home Depot, which has more than 2,200 retail stores and over 300,000 associates, reaffirmed its call for 2012 sales to rise 4.6%.

Shares of the blue-chip retailer picked up 1.57% to $53.65 in premarket action, putting them in position to tack onto their 2012 rally of 26%.

Follow Matt Egan on Twitter @MattMEgan5