Home Depot on Tuesday reported second-quarter earnings and sales that far surpassed expectations, reaping the benefits of a warmer start to the summer.

The home improvement retailer, which had a rocky spring season, also raised its outlook for revenue and same-store sales for the full year, saying the number of customer transactions jumped during the quarter, and shoppers were spending more at its stores.

Home Depot shares climbed less than 1 percent in early trading on the news.

Here's what the company reported compared with what Wall Street was expecting, based on a survey of analysts by Thomson Reuters:

Earnings per share: $3.05 vs. $2.84 expected

Revenue: $30.46 billion vs. $30.03 billion expected

Same-store sales: up 8 percent globally vs. an increase of 6.6 percent expected

Spring was chilly in much of the U.S., prompting many homeowners to push back their gardening and remodeling projects into summer. Despite the headwinds, consumers are still investing in their properties to see prices appreciate.

"If you are a homeowner and your home is continuing to go up in value, you feel much more comfortable investing back in that home," Oppenheimer analyst Brian Nagel told CNBC.

Sales on a per-square-foot basis climbed 8.6 percent during the quarter, according to the retailer. It also said the average shopper's ticket jumped 5 percent to $66.20 and customer transactions were up 3.1 percent overall.

Home Depot sales have accelerated more broadly thanks to a strong housing market in the U.S. and economic tailwinds. Consumer spending on home improvement items hasn't fluctuated as much as on apparel, for example. In previous quarters, Home Depot was helped by homeowners in recovery mode making repairs after severe storms including Hurricanes Harvey, Irma and Maria in 2017.

The Atlanta-based retailer is focused on growing its professional homebuilder business and believes that by bolstering its delivery platform it will be able to take a larger share of this market. The company said earlier this year it plans to spend $1.2 billion during the next five years to bulk up its supply chain, with the goal of getting online orders to shoppers more quickly.

Net income for the second quarter of fiscal 2018 climbed to $3.5 billion, or $3.05 per share, compared with $2.7 billion, or $2.25 per share, a year earlier. The results topped Street expectations for earnings of $2.84 a share.

Revenue climbed 8.4 percent to $30.46 billion from a year ago, surpassing expectations for $30.03 billion. That included online sales growth of roughly 26 percent.

Same-store sales were up 8 percent globally, topping expectations for a 6.6 percent increase. In the U.S., same-store sales climbed 8.1 percent, again beating the expected 6.4 percent growth.

"As expected, the majority of seasonal sales we missed in the first quarter were recovered in the second quarter," CEO Craig Menear said Tuesday morning during a call with analysts and investors. "Customers continue to respond to ongoing investments and enhancements we are making in support of the customer experience."

The company said some of its top-selling categories included lumber, indoor garden, outdoor garden and electrical. It said "big-ticket purchases" — or those over $1,000 — now represent 20 percent of sales in the U.S. and were up 10.6 percent during the quarter from a year earlier.

Speaking to recent proposals by President Donald Trump's administration on tariffs for items like lumber and appliances, Home Depot called the situation "manageable." It said it's starting to receive increased cost requests from certain suppliers, but those should subside as some manufacturers open domestic facilities.

Looking to the full year, Home Depot now expects revenue to climb roughly 7 percent, compared with a prior forecast of 6.5 percent growth. Same-store sales should be up about 5.3 percent in fiscal 2018, Home Depot said, up from a previous target of 5 percent growth.

In keeping with a $15 billion share buyback plan announced in December, Home Depot said Tuesday it will buy back $6 billion worth of stock this year.

Home Depot shares have climbed roughly 25 percent from a year ago, bringing the retailer's market cap to $223.9 billion. By comparison, rival Lowe's market cap is $79.2 billion, and its stock has risen about 26 percent since this time last year.