(Bloomberg) -- Target Corp. shares soared after its third-quarter earnings report showed improved operational competence, with fewer markdowns and better inventory management driving profits past estimates even as the US big-box retailer’s sales kept sliding.

Inventory declined 14% from a year earlier, continuing the trend of the past several quarters. The shares closed up 18% in New York trading on Wednesday, the largest daily rise since 2019. 

Yet Target’s business isn’t quite in the full bloom of health. Comparable sales fell 4.9%, a second straight quarterly drop driven by lower spending on discretionary categories. That decline was the second-largest since 2009 — trailing only the 5.4% drop in the previous quarter — but was still better than analysts expected.

“We’ve seen in the industry seven consecutive quarters where discretionary goods have declined in dollars and units,” Chief Executive Officer Brian Cornell said on a call with analysts. Consumers are “carefully shopping for those new items.”

Read More: US Retail Sales Slow Ahead of Holidays, But Remain Resilient

Sales weakness was partially offset by strong performance in “frequency” categories like beauty, which are more likely to fuel repeat purchases. Target has an in-store partnership with Ulta Beauty, and added products from Rihanna’s Fenty Beauty collection in the third quarter.

“Substantially lower inventory suggests the retailer has less markdown risk for the holiday sales season,” Bloomberg Intelligence analyst Jennifer Bartashus wrote in a note. “Still, execution will be key to regaining shopper visits and winning seasonal sales.”

Like Home Depot Inc., which reported results Tuesday, Target showed evidence that retailers can no longer count on inflation to drive revenue as price rises moderate. Target’s food sales fell slightly in the quarter due to a decline in average prices, Chief Growth Officer Christina Hennington said on a call with media.

Gross margin of 27.4% exceeded forecasts for the third quarter and improved from a year ago, which Target attributed to the inventory improvements as well as lower costs for freight and digital fulfillment. Supply-chain costs also fell.

Theft, which the company cited for store closures in September, appears to be easing as a pressure point for Target. The retailer said shrink — an industry term that refers to merchandise lost due to theft, damage and vendor error — partially offset margin improvements in other areas but had a smaller impact in the third quarter than in the previous two. 

In the current quarter, Target sees earnings in a range of $1.90 to $2.60 a share, while the average analyst estimate is $2.23, according to data compiled by Bloomberg. 

Cornell said in a call with reporters that the company is watching the impact of rising interest rates, the renewal of student-loan payments and higher credit-card balances. He added that there’s no single factor that’s a primary contributor to shifts in consumer behavior.

(Updates with closing share price.)

©2023 Bloomberg L.P.