Macy’s (M) released its second-quarter 2020 earnings report on Wednesday, which showed an increase in e-commerce sales by 53% over Q2 2019.

The boost in its online business propelled Macy’s forward as stores were temporarily closed during the coronavirus pandemic, but it wasn’t enough to avoid a loss as comparable sales were down 34.7% for the quarter compared to the same timeframe last year.

Macy’s said it saw “better than expected growth of its digital business” as sales remained strong, making up 54% of total-owned comparable sales.

“Macy’s, Inc. performance for the quarter was stronger than anticipated across all three brands: Macy’s, Bloomingdale’s, and Bluemercury, driven largely by the sales recovery of our stores,” Chairman and CEO Jeff Gennette said in a statement. “Restarting our stores’ business was our top priority, and we successfully accomplished that while also ensuring that our digital business remained strong.

“Going into this crisis, we had a well-developed digital business, and we’re seeing that thrive as we attract new and welcome existing customers back to our brands,” he added.

Macy’s delivered a gross margin of 23.6%, which was an increase of about 650 basis points compared to the first quarter of 2020. The company attributed the increase to improved retail margins from a mix and better sell-through of its clearance merchandise.

Inventory for the company was down 29% compared to 2019, which the department store retailer said allowed it to exit Q2 in a “clean inventory position.” Macy’s also finished the quarter with “strong liquidity” with about $1.4 billion cash on hand and $3 billion available on its asset-based credit facility.

“We are encouraged by our second-quarter performance; however, we continue to approach the back half of the year conservatively,” Gennette said. “Our immediate priority is successfully executing holiday 2020. We are also focused on laying the groundwork for 2021 and beyond.

“We plan to invest in fashion, digital sand omnichannel, work with agility, and galvanize the resources of the company to serve our customers and move the Macy’s, Inc. business forward,” he continued.

Macy’s withdrew its 2020 sales and earnings guidance previously, declining to provide any update on the outlook based on the “uncertainty” of the coronavirus pandemic.

Shares of Macy's were at $7.28 as of 9:47 a.m. EDT, up 27 cents or 3.84%.

Macy's Job Cuts
Macy's department store's logo in New York City on Jan. 8, 2009. Getty Image/Emmanuel Dunand