McDonald’s shook off its long sales slump, posting quarterly increases in sales in older stores on Thursday for the first time in two years.

The company’s same-store sales, reflecting sales in stores open for more than a year, grew 4 percent in the third quarter, which ended Sept. 30. More important, its troubled stores in the United States showed growth, albeit modest, of 0.9 percent.

“We’re focusing on fewer, bigger initiatives, and the progress we’ve made in a short amount of time give me confidence that we are making the right moves,” Steve Easterbrook, McDonald’s chief executive, said in a conference call with investment analysts on Thursday.

The news sent McDonald’s shares soaring. They closed up more than 8 percent, at $110.87.

Overall sales were down 5 percent to $6.6 billion, from $7 billion in the same period a year ago, as the strong dollar dented reported figures. Adjusting for the currency swing, sales would have grown 7 percent.

Earnings grew to $1.3 billion, or $1.40 a share, a 23 percent increase from the same period a year ago, when McDonald’s earned $1.1 billion, or $1.09 a share. When adjusted for exchange rates, the increase in earnings would have been a startling 44 percent.

The company also spent $3.1 billion on share buybacks and dividends, a move that improves reported earnings per share.

Analysts were expecting sales growth, if only because the company’s comparable performance last year was so weak. Still, McDonald’s beat their estimates of $1.27 a share in earnings and predictions of a slight decline in U.S. store sales.

Easterbrook noted the success of the company’s Premium Buttermilk Crispy Chicken Deluxe Sandwich and the positive impact of returning to the original recipe for Egg McMuffin, with fewer ingredients.

The company recently began offering customers some items on its breakfast menu all day long, and the analysts repeatedly peppered Easterbrook with questions about it.

He did not offer much insight into sales generated by what McDonald’s calls “All Day Breakfast,” saying it was too early to say how the program, which was officially introduced on Oct. 6, was doing. “I’m a fairly resilient guy — I won’t get run down by the same question repeatedly,” he joked near the end of the call.

Foursquare, an app-based geolocation service, figured that visits to McDonald’s stores around the country increased by 9 percent in each of the first two weeks the company began offering breakfast items all day — but by the third week, visits were expected to be roughly 2 percent higher.

Comparatively, after Taco Bell began offering breakfast in May 2014, visits to its stores jumped as much as 25 percent, according to Foursquare. The trend persisted about three weeks. Foursquare estimated that adding breakfast to the menu increased Taco Bell’s traffic 5 to 10 percent after the novelty wore off. Taco Bell has said breakfast added about 7 percent to its sales.

McDonald’s saw its strongest growth in the third quarter in overseas markets. Comparable store sales in China, which were hit hard last year in the third quarter by a scandal over the handling of chicken products by a supplier, jumped 26.8 percent in the latest quarter.

The company’s move to increase wages and benefits for workers in the 1,400 restaurants it owns put a slight dent in operating profits, but Easterbook insisted the investments would pay off in the long run by reducing turnover, which in turn would improve customer experience because employees would be more experienced and motivated. “Part of the bigger picture is running better restaurants, running better teams,” he said.

He also went further in explaining the company’s commitment to simplification, noting that it would not always be about paring items from menus or reducing the ingredients in items. He noted, for example, that restaurant operators already had the ingredients on hand to make breakfast all day. The only change is that they now are making breakfast at times once exclusively devoted to making the company’s other menu items.

Easterbrook said the company was also finding ways to simplify operations, in some cases using technology. “The way to look at this is that menu is part of it, but there’s a lot more we can do to help simplify the restaurants on a day-to-day basis,” he said.