McDonald’s Corp. didn’t just increase business in its important home market in the fourth quarter. It regained customers lost from its competitors over the past two years.

And the burger chain can largely thank all-day breakfast for that.

The company said that same-store sales in the fourth quarter ended Dec. 31 increased 5.7 percent — the best performance for the chain since its same-store sales rose 8.9 percent in the first quarter of 2012, nearly four years ago.

By comparison, quick-service sandwich chains’ same-store sales rose 2.8 percent during those three months, company executives said Monday. That’s a 2.9-percent gap.

“We’ve regained market share we’ve given up in recent years,” McDonald’s CEO Steve Easterbrook said during the company’s fourth quarter earnings call Monday. “We had good momentum in our business before the quarter began, and it accelerated through the fourth quarter.”

Easterbrook was not ready to declare the turnaround successful, however. He noted that the company needs another six months before it can start shifting its planning toward more long-term growth.

“We had two quarters of growth in our turnaround,” Easterbrook said. “I’d like to see another quarter or two before we move to a longer-term growth plan. By the middle of the year, I’m confident it [will be] the right time to transition to long-term growth plans.”

Indeed, the company said in its earnings filing that it remains focused on generating higher customer counts. For the full year, even despite the strong fourth quarter, customer counts fell 3 percent at McDonald’s. That came after a 4.1-percent decline the year before. Fourth-quarter traffic numbers were not available.

Investors had been expecting a strong McDonald’s report for months — the company’s stock price was up about 10 percent in the weeks preceding the report and had managed to remain flat this year despite an ugly stock market. The company’s stock was up about 2 percent by early afternoon trading and had hit a new 52-week high.

McDonald’s reported same-store sales growth in all of its major segments. But investors had been closely watching U.S. results, where the company has been weak amid intense competition from other burger chains. The company has 14,000 of its more than 36,000 locations in its home market, where it gets more than a third of its revenues.

That home market is slightly smaller now than it was a year ago, too: McDonald’s domestic unit count last year declined by 91 locations, to 14,259 units, from 14,350 restaurants. Overall, however, the company added 267 locations worldwide, to 36,525 units.

The primary driver of domestic sales growth in the fourth quarter came from the company’s decision to start selling a selection of nine breakfast items after 10:30 a.m., answering a demand from customers that dates back years. That also represented arguably the biggest news in the entire quick-service restaurant sector during the period.

The performance of all-day breakfast “exceeded our launch expectations and for a period longer than we anticipated,” Easterbrook said.