McDonald’s Corp. on Thursday posted strong growth in a key sales metric, demonstrating the company’s resilience in a turbulent economy as it dominates competitors.

McDonald’s reported global comparable sales rose 10% in the quarter ended September 30, a figure that measures how existing stores have performed over time.

The growth can be attributed to effective marketing and digital campaigns and the company’s entrenched brand which attracts loyal customers who see McDonald’s as a value option. Both advantages have put the company in a position to weather a possible recession, executives say.

The company reported $5.8 billion in revenue, narrowly beating analyst estimates but a 5% drop from the same period last year. Profits followed the same trend: the company pulled in $1.9 billion in net income last quarter, 8% lower than the third quarter in 2021.

Analysts say the year over year drop can be attributed to the economic environment rather than company weakness.

“The economic backdrop has deteriorated a lot,” said Sean Dunlop, equity analyst at Morningstar, noting that although the company raised prices 10% this year in the US, traffic has remained strong. “That’s both extremely impressive in terms of attestation to the brand’s strength, but also pretty unusual.”

McDonald’s is a bellwether among quick-service restaurant chains, but some of its peers have struggled with rising costs. Domino’s, which reported its earnings earlier this month, came in below analyst expectations across the board. Chipotle’s revenue was also a disappointment in its earnings report released Tuesday.

McDonald’s shares rose more than 3% Thursday to close at $265. The reaction bucked market trends as major indexes fell throughout the day, in line with its performance so far this year. The S&P 500, which contains McDonald’s stock, has fallen nearly 19% since January. McDonald’s shares are up 1.7%.

Inflation is eating into restaurant profits as the industry is pinched between price increases for its supply and increasingly tight-fisted consumers. Companies often have no choice but to increase prices, although McDonald’s hasn’t seen much blowback from that.

In a conference call with analysts Thursday morning, CEO Chris Kempczinski said that McDonald’s is set up to withstand the headwinds because of investments in forward-looking technology and the company’s enduring value to customers.

“It’s allowed us to push through some of this pricing, but I think because of the strength of the brand and the proposition, as evidenced by the results, the consumers are willing to tolerate it,” said Kemczinski.

Executives acknowledged that a recession may be on the horizon. “Kempczinski was the first restaurant CEO to pull out the r-word,” Dunlop said, signaling that the company is prepared to take a possible downturn into account.

Kempczinski has emphasized the importance of going digital since he took over in 2019, months before the pandemic hit. That strategy has paid off, analysts say.

“It turns out that digital sales penetration is a very loyal sales customer,” said John Gordon, principal at Pacific Management Consulting Group. “It is a somewhat more profitable customer than just a normal street sale.”

McDonalds reported earnings per share at $2.68 in the third quarter, ahead of analysts’ predictions of $2.58.

But the company is not out of the woods. It must contend with its plan to re-contract all of its franchises. Next year, the company says it will implement a new evaluation system for renewing franchisee’s 20-year agreements, which could result in closing some locations. “There is risk in pushing out your experienced operators,” Gordon warned.