Home Depot (NYSE:HD) executives set high expectations for the retailer's second quarter. Back in May, CEO Craig Menear and his team predicted that just about all the sales that hadn't happened in the first quarter -- due to an unseasonably cold April -- would be pushed into the second quarter to keep the company's growth pace on target for the year despite a customer traffic slump to start 2018.

In its second-quarter report released this week, the home improvement giant outperformed those bullish goals. As a result, management lifted its fiscal year outlook on both the top and bottom lines.

A man replacing a window in a home.

Image source: Getty Images.

Let's take a closer look.

Sales come roaring back

Home Depot executives noticed in early May that as weather turned warmer in key parts of the country, shoppers spent aggressively on those seasonal items that in years past they would have purchased in April. Comparable-store sales were up by double digits at the start of the fiscal second quarter, they said, compared to a 4% uptick in the prior quarter.

The full-quarter numbers weren't quite that high, but they still beat Home Depot's targets. Comps jumped 8% during the period to double the prior quarter's growth rate, in fact. "Not only did our seasonable business rebound from the first quarter," Menear said in a press release, "but our overall results exceeded our expectations."

Home Depot returned to solid customer traffic growth by logging a 3% shopper increase compared to a 1% drop in the first quarter. Average spending jumped 5%.

The six-month metrics are more useful in assessing the retailer's overall trends since they smooth out the impact of the volatile spring selling season. Those figures show healthy sales growth, with customer traffic up 1.1% and average spending higher by 5.5%. Together, these numbers translate into comps growth of just over 5% so far in 2018.

Profits are steady

Home Depot didn't have to sacrifice profitability to achieve that impressive growth, either. Sure, selling expenses rose at a faster pace than sales, just as the company had predicted. The retailer is spending aggressively on growth initiatives like e-commerce right now, which management says might pressure profitability this year.

HD Operating Margin (TTM) Chart

HD Operating Margin (TTM) data by YCharts.

But gross profit margin expanded at an even faster pace and allowed operating profits to jump to $4.9 billion, or 16.1% of sales, from $4.5 billion, or 15.9% of sales, a year ago. Zooming out a bit, that core profitability figure now stands at 14.9% over the past six months, compared to 15% in the prior-year period.

Expecting a good year

With the spring selling push behind it, Home Depot is in a better position to forecast how its full 2018 might progress. And management is more optimistic about the company's chances for solid sales and profit gains this year. Comps are now expected to rise 5.3% to mark a modest upgrade over the prior 5% goal. Keep in mind that these gains are coming on top of a fiscal 2017 that included significant sales growth related to hurricane rebuilding efforts.

Earnings should now jump by 29% to $9.42 per share rather than the 28% increase executives had predicted back in May.

Meanwhile, the company made a major change to its capital allocation plan that reflects the management team's rising confidence. Home Depot is now planning to spend $6 billion on stock buybacks this year, up dramatically from its initial target of $4 billion.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.