Customers have been turning to Walmart (WMT 0.18%) to fulfill their essential needs during the COVID-19 pandemic, and the company saw a large increase in sales as a result. Operating income increased as well, but was negatively affected by increased costs related to the health crisis.

A huge surge in sales

Revenue increased 8.6% year over year to $134.6 billion, a huge increase from the past four quarters, when total revenue increased around 1% to 2% each quarter. Comps soared 10%, also much higher than a typical recent quarter. eCommerce grew 74%, focused on grocery pickup and delivery, as well as Walmart.com and the marketplace.

A Walmart employee packing a shipment.

Image source: Walmart.

However, there was also an increase in costs related to higher wages and bonuses for employees as well as new safety and sanitation measures to keep both workers and customers safe. These extra expenses amounted to close to $900 million. 

Diluted earnings per share increased 5.3% to $1.40. The company ended the quarter with $5.3 billion in free cash flow, up from $3.9 billion at the end of the previous quarter.

Across all divisions

Walmart U.S. comps increased 10% as customers stocked up on food and consumables, and there was also strength in health and wellness and some of the general merchandise categories.

International was up 3.4%, and Sam's Club comps grew 12%, a greater increase than rival Costco's 9.1% U.S. comps in the second quarter.

"Customers trust us to deliver on our brand promise, and I'm confident in our ability to perform well in most any environment," said CFO Brett Biggs.