Home Depot shares fell nearly 2% in Tuesday’s premarket after the company reported that first-quarter profits were weighed down by costs related to the coronavirus pandemic.

It said sales rose sharply.

For the first quarter that ended May 3, Home Depot reported that net income fell 10.7% to $2.25 billion, or $2.08 per share, compared with $2.51 billion, or $2.27 per share, a year earlier. Analysts surveyed by Refinitiv expected the company to earn $2.27 per share.

Revenue for the quarter rose 7.1% to $28.26 billion from $26.38 billion a year earlier, topping analyst expectations of $27.54 billion. Home Depot’s same-store sales grew 6.4%, beating expectations of 4.4%, based on StreetAccount estimates.

However, it’s difficult to compare reported earnings with analyst estimates for the first quarter because the coronavirus pandemic has changed customers’ shopping patterns and added additional labor and safety costs for companies.

Home Depot said it took a number of steps to boost wages and keep employees coming in during the pandemic. The company said it expanded paid time off for all hourly employees, as well as for non-hourly workers deemed at-risk for Covid-19 infection by the Centers for Disease Control and Prevention’s guidelines. It said it has also provided more incentives to keep workers coming in, such as doubled overtime and weekly bonuses as well as expanded benefits.

All told, Home Depot said these measures cost it $640 million after tax, or about 60 cents a share.

“As the COVID-19 pandemic evolved, we anchored to the core values of our Company by focusing on two key priorities: working to ensure the safety and well-being of our associates and customers, and providing our customers and communities with essential products,” CEO Craig Menear said in a statement. “We took early and decisive action to intentionally limit customer traffic in our stores which we believe had a significant impact to sales in many markets.”

Home Depot’s sales per square foot were $466.58, up more than 7% from $435.18 a year earlier. Its average ticket also increased to $74.70, up about 11% from $67.31 a year earlier due to a “notable increase in basket size,” executive vice president of merchandising Ted Decker said on a conference call with investors. He added that early March saw a pop in sales of cleaning, safety and security products.

“They were really focused on getting everything they needed in one trip,” Menear added of customer behavior in March on the call.

The coronavirus and the changes in consumer trends it’s spurned have led to a boom in Home Depot’s e-commerce business, Decker said.

“As shelter-in-place orders rolled out across the country in mid- to late-March, we saw our digital businesses accelerate from approximately 30% growth in early March to triple digit growth in early April” he told investors. “During the last three weeks of the quarter, traffic to HomeDepot.com was consistently above Black Friday levels.”

Home Depot said its sales remained strong through the first two weeks of the second quarter, but it is nonetheless suspending its 2020 guidance due to uncertainty related to the crisis.

When broken down by do-it-yourself customers and professionals, both grew but DIY sales outpaced pro sales, Decker said, adding that state restrictions due to the coronavirus have affected at least some of Home Depot’s pro customers.

“The smaller pro actually performed well throughout the quarter with more pressure on the larger pro,” Menear told investors on the call.

Home Depot has had a few advantages going into the pandemic compared with other retailers. It’s been deemed an essential retailer in most states, so its stores have remained open. It has invested in e-commerce and online offerings, such as curbside pickup. And spring is historically the busiest time of the year for the home improvement industry.

The company’s stock bottomed in the first quarter at a $152.15 closing price on March 20 just as state-by-state restrictions were rolling out across the country in the midst of Home Depot’s busy season. However, the stock has bounced back, reaching record highs earlier this week, bringing its market cap to more than $263 billion.

The investment in retaining employees with added benefits and boosted wages will prove to be a smart long-term decision, senior equity research analyst at Oppenheimer Brian Nagel told CNBC’s “Squawk Box.”

“I think Home Depot is one of the companies that is benefiting or really capitalizing, performing well through this Covid-19 crisis and is likely to perform well as the crisis headwinds abate,” Nagel said. “More people are spending more time in their homes, and you’re seeing that increase spend as more people spend more time working on their houses.”

Looking toward the second quarter, Home Depot’s performance will be largely tied to its ability to ease restrictions that limit store traffic, Jefferies equity analyst Jonathan Matuszewski said in a note to clients. He added that limiting costs associated with the company’s response to the coronavirus will also be key to protecting earnings.

“Given HD’s commentary, it will be key to understand the maintenance or potential loosening of such actions heading into the typically-promotional Memorial Day Weekend,” he said in the note. “If the home improvement centers can constrain incremental expenses to meet outsized traffic while still protecting customers/employees, EPS should improve.”

The company said it has canceled major spring season promotions that drive foot traffic to stores, such as Black Friday-like events. It also has been enforcing social distancing in its stores, and it has distributed thermometers to employees who work in stores and distribution centers so they can monitor their temperatures.

The company previously said it would hire 80,000 additional employees, with many part-time hires staffing its garden center, on par with spring hiring in recent years despite disruption from the pandemic.

The Atlanta-based retailer previously said it planned to invest $3.9 billion in 2020 toward further integrating its online business with its traditional stores. Home Depot did not address the status of the investment in its earnings release. The investments have helped Home Depot to shorten delivery time and develop a more user-friendly website. It’s also sought to streamline curbside pickup with automated lockers for customers.