With millions of people staring at their walls working from home, sales at Home Depot surged in the second quarter, with same-stores sales in the U.S. spiking 25%.

Overall revenue for the Atlanta company hit $38.05 billion, far exceeding the $34.94 billion Wall Street was expecting, according to a FactSet survey. It easily topped last year's revenue of $30.84 billion for the three months ended Aug. 2.

Sales at stores open at least a year, a key indicator of a retailer's health, climbed 23.4%, globally, trailing only the massive surge in comparable-store sales in the U.S.

Home Depot aisles are stocked with hurricane supplies as Hurricane Isaias approaches South Florida onFriday, July 31, 2020 in Boynton Beach, Fla. Isaias is forecasted to stay east of the coast but it will bring winds and possible coasting flooding. (Amy Beth BennettSouth Florida Sun-Sentinel via AP)

Home Depot aisles are stocked with hurricane supplies as Hurricane Isaias approaches South Florida onFriday, July 31, 2020 in Boynton Beach, Fla. Isaias is forecasted to stay east of the coast but it will bring winds and possible coasting flooding. (Amy Beth BennettSouth Florida Sun-Sentinel via AP)

The National Association of Realtors said last month that its index of pending sales rose 16.6%, to 116.1 in June, its highest level since 2006. Sales of new homes also rose a sharp 13.8% in June, the second straight increase.

Home Depot Inc. earned $4.33 billion, or $4.02 per share, in the quarter, which was also far stronger than the per-share projections of $3.70 from analysts.

A year earlier it earned $3.48 billion, or $3.17 per share.

Shares rose nearly 3% in Tuesday premarket trading.