Costco said Thursday its net income for the latest quarter was $1.2 billion, a 45.6% increase from 2020’s third quarter.

Net sales rose 21.7%, to $44.38 billion, with e-commerce leading the way in growth as the pandemic continued to limit in-store shopping in much of the nation.

The Issaquah-based discount warehouse giant said COVID-19-related costs, primarily for $2-an-hour premium pay, were $57 million in the latest quarter, which ended May 9. A year earlier, the company reported $283 million in such pretax costs.

Costco’s e-commerce sales have been a smaller factor in its business strategy than for many other retailers. But during the pandemic online sales have surged, growing 38.2% for the latest quarter and 63.6% over nine months compared to the prior periods. (Those figures are adjusted to exclude foreign exchange and gas prices.)

The company’s revenue, which also counts membership fees, rose 21.4% to $45.3 billion.

Costco shares, which are trading close to a multiyear high, slipped less than 1% to $384.30 in initial after-hours trading following the earnings release.