For much of the pandemic, Target Corp. turned insatiable demand into record growth. But Wednesday, executives at the Minneapolis company had to explain a significant drop in profit.

Target's profit fell 90% in the May-through-July period as the company cut prices and canceled orders to get rid of items that weren't selling. It warned in June that inventory had grown out of hand.

"The vast majority of the financial impact of these inventory actions is now behind us," Target CEO Brian Cornell said.

Target said it earned $183 million, or 39 cents a diluted share, for its second fiscal quarter. That was 33 cents below the consensus forecast of analysts. Revenue grew 3.5% to $26 billion. Its shares fell 2.7% on the news.

Target reduced $1.5 billion of orders for discretionary products planned for the fall. Even so, its inventory at the end of the quarter was $15.3 billion, up from $15.1 billion three months earlier.

Over-ordering is at the heart of Target's inventory woes. For the past couple of years, it and other retailers bought products in excess to try to get ahead of shipping delays. Target executives attributed a portion of the increase in inventory value to inflation.

"I think everyone had a bit of a glut in inventory ... but Target has seemed to be affected a lot more by this then almost any other retailer out there," Neil Saunders, managing director of the data analytics company GlobalData, said in an interview.

By contrast, Walmart on Tuesday posted quarterly profit growth of more than 20% and said it had reduced its inventory value by more than 2% compared with the spring.

"I think it does show that Target has really managed this very badly. ... And I think that's on them," Saunders said.

Cornell said it made more sense to immediately address inventory bloat rather than let goods clutter stores and warehouses.

Consumers who now face higher prices on everything from gas to groceries are shifting to buy lower margin necessities, such as food. At the same time, retailers are also suffering from higher transportation and goods costs.

There were bright spots in Target's numbers. Despite lapping a strong growth period last year, the company's comparable sales grew nearly 3% along with traffic to its stores and website that also grew close to 3%. Same-day services, including curbside drive-up, continue to be popular, rising nearly 11% compared with last year.

Grocery, beauty and household essentials continued to be top performers as customers facing high inflation focused more on purchasing necessities. Home and apparel sales declined.

Customers are turning to Target's own brands of products more frequently and responding more to promotions, said Christina Hennington, Target's chief growth officer.

"They still have spending power, but they're increasingly feeling the impact of inflation," she said. "And while the recent reduction in prices at the gas pump has been encouraging, guests' confidence in their personal finances continues to wane."

Cornell said back-to-school, which is typically a well-performing shopping season for Target, showed strong sales this summer. The company anticipated that Halloween would also bring high consumer activity.

Target executives also reported growth in toy sales, which they said was as an encouraging sign for the holiday season.