Walmart Inc nudged up its annual profit forecast on Tuesday, partly reversing a hefty cut less than a month ago, as discounts to clear excess merchandise and lower fuel prices helped it beat expectations for quarterly sales.

The stock, which has fallen over 8% this year, rose 3.7% in premarket trading. Shares of rivals Target Corp, Costco and Best Buy also climbed on the news, while futures for the blue-chip Dow index cut losses.

Walmart said it now expected fiscal 2023 adjusted earnings per share to fall 9-11%.

Last month, the top U.S. retailer spooked markets across the globe when it forecast a drop of 11-13% - down from previous guidance for a 1% fall - and warned consumers were pulling back on discretionary purchases at a far greater pace than feared as soaring inflation hit their spending power.

That forced Walmart to make steep price cuts on items such as apparel to try to reduce more than $61 billion worth of inventory it was sitting on at the end of the first quarter.

A host of other retailers including Target Corp and Best Buy Co Inc have also issued profit warnings in recent weeks as they struggle with excess merchandise.

Walmart reported inventories of $59.92 billion at the end of the second quarter to July 31, still 25% above last year's levels.

"I think it's going to take another quarter, maybe get into the fourth quarter a little bit, to get back to where we want to be from an overall inventory perspective," Walmart's Chief Financial Officer John David Rainey said.

Rainey, who joined Walmart in May, added consumers were continuing their purchasing patterns of buying more low-margin food and consumables over general merchandise, despite an easing in gas food prices. They are trading down and allocating more spending to private-label products, he said.

"Instead of buying maybe deli meats or beef, they're trading down to things like canned tuna, chicken and, even, beans. We're seeing the same thing in the quantity, where they're trading down for smaller pack sizes that are more affordable. So instead of buying 12 items to buy six items in a pack," Rainey said.

Home, electronics and apparel are still "problematic" categories, Rainey said.

Back-to-school shopping gave Walmart's sale a boost at the end of July, but many parents opted for school supplies instead of clothing. Rainey said he expected back-to-school apparel shopping to pick up in the coming weeks.

BACK-HALF VIEW MAINTAINED

Since the last round of quarterly results, the prices consumers pay for goods and services have shown signs of easing. The consumer price index rose 8.5% in July, less than in the previous month, due largely to a 17% drop in gasoline prices.

This helped to drive a 6.5% rise in sales at Walmart's U.S. stores that have been open for at least a year, beating its prior forecast for a 6% gain.

Total revenue rose 8.4% to $152.86 billion in the second quarter, beating analysts' average expectation of $150.81 billion, according to IBES data from Refinitiv.

However, discounts on discretionary products, slowing demand for high-margin items such as appliances, electronics and clothes, and rising labor costs led to a 6.8% fall in the company's quarterly operating income to $6.85 billion.

The Bentonville, Arkansas-based retailer now expects consolidated net sales growth of about 5% and adjusted earnings to decline 9.0% to 11.0% in the third quarter. Same-store sales for Walmart U.S., excluding fuel, are expected to rise 3%, the company said. It also maintained its forecast for 3% same-store sales growth for the rest of the year.

"Walmart maintained its outlook for the second-half of the year - an indication that, even with lower gas prices, consumers are still looking at buying less and cheaper on their weekly shopping trips, Jefferies analyst Stephanie Wissink said.