By Micah Maidenberg

Ross Stores Inc. warned of challenges tied to the pandemic ahead as it reported weaker sales for its latest quarter, the latest example of a retail chain that shut stores due to the coronavirus struggling to get back to higher levels of demand after reopening locations.

Ross, which runs Ross Dress for Less and DD's Discounts stores, on Thursday said it generated $2.68 billion in sales for its fiscal-second quarter, which ended Aug. 1. Sales were down 33% from the comparable period last year but ahead of the $2.51 billion that analysts expected, according to FactSet.

The pandemic has showcased divides across the retail sector. Companies selling food and staples used at home, like Walmart Inc. and Target Corp., have gained ground, staying open throughout the crisis and reaching more shoppers with e-commerce operations.

But other chains that shut their stores as nonessential businesses earlier this year have struggled. TJX Cos., the parent of T.J. Maxx and other stores, saw quarterly sales fall by almost one-third, while L Brands Inc., the parent of Victoria's Secret and Bath & Body Works, said sales were down 20%.

Ross reported a quarterly profit of $22 million, or 6 cents a share, compared with earnings of $412.7 million, or $1.14 cents a share, a year earlier.

Analysts expected a loss of 25 cents a share, or 28 cents a share following adjustments.

Dublin, Calif.-based Ross said it had reopened "vast majority of its retail locations open and operating by the end of June."

During the initial phase of store reopenings started in May, sales were ahead of its plans due to pent-up demand among consumers and Ross's move to aggressively mark down older products to clear inventory, Chief Executive Barbara Rentler said.

"In the weeks thereafter, trends were negatively impacted from depleted store inventory levels while we were ramping up our buying and distribution capabilities," she said in a statement.

Comparable sales dropped 12% for reopened stores from the date they opened their doors again to the end of the company's latest quarter.

Ross has seen comparable sales for the first two and a half weeks of its fiscal third quarter "down mid-teens versus last year. There remains significant uncertainty on how the pandemic will continue to evolve and affect consumer demand and the economy, and the potential exists for additional government mandated shutdowns if Covid-19 cases remain elevated or further increase," Ms. Rentler said.

Write to Micah Maidenberg at micah.maidenberg@wsj.com