By Matt Grossman

Home Depot Inc. reported higher sales in the latest quarter despite the large-scale disruption caused by the coronavirus pandemic, but the company's expenses rose sharply as it boosted workers' pay and benefits.

Revenue in the fiscal first quarter was $28.26 billion, compared with $26.38 billion a year earlier. Analysts expected $27.56 billion, according to FactSet.

Comparable sales rose 6.4% overall, and 7.5% in the U.S. during the period, which stretched from February to May. The rise partially reflected more interest in do-it-yourself projects, the company said, as people faced stay-at-home orders during the pandemic.

"Clearly, the customer is reengaged with DIY," Chief Executive Craig Menear said on a call with analysts.

Customers spent an average of $74.70 per transaction during the quarter, up 11% from a year earlier, while the number of transactions fell 3.9% to 374.8 million. The pattern reflected people's desire to limit trips to the store, Mr. Menear said.

Sales from Home Depot's digital platforms grew by about 80% in the quarter as people favored online shopping over in-person browsing during the pandemic, according to Chief Financial Officer Richard McPhail, who said the online sales bore out the company's past technology investments.

"Demand for buy online, pick up in store really took off," Mr. McPhail said.

Home Depot is among a small group of retailers, positioned to do well during the pandemic because its stores have remained open and consumers stocked up on household goods. Also Tuesday, Walmart reported global revenue rose 8.6% to $134.62 billion in the latest quarter.

Despite positive sales trends in the first quarter and the first two weeks of the current quarter, Home Depot withdrew its guidance for the year, citing the uncertainty of the pandemic.

Earnings per share of $2.08 were below the $2.30 analysts polled by FactSet were expecting. The company said that its results included $640 million, or 60 cents a share, of after-tax added expense related to steps the company took to support its employees.

The added costs were largely from paid-leave expenses that won't recur in the future, according to Mr. McPhail.

"We have seen the full impact occur all in the first quarter," Mr. McPhail said. He added that other enhanced compensation, such as higher overtime pay, has continued into the second quarter.

Overall, expenses totaled $6.4 billion, up 17% from a year earlier.

Shares of Home Depot fell 2.4% to $239.58 at midday.

Against the backdrop of a declining stock market, Home Depot stock has still outperformed this year. The company's shares have risen about 10% since the start of the year, a period when the S&P 500 index has declined overall.

Write to Matt Grossman at matt.grossman@wsj.com