Breakfast around the clock is helping shake McDonald’s out of its slump.

The world’s biggest hamburger chain says the launch of an all-day breakfast menu and unseasonably warm weather helped lift sales by 5.7 percent in the U.S. for the final three months of the year.

It’s the second straight quarter of domestic growth as McDonald’s fights to win back customers, and the best showing since early 2012. Globally, sales rose 5 percent at established locations.

McDonald’s, which has more than 36,000 locations around the world, is working to turnaround its business under CEO Steve Easterbrook, who will mark one year on the job in March.

One of the biggest changes under Easterbrook was to make the Egg McMuffin and other select breakfast foods available past normal breakfast hours in the U.S. — an option many customers had long desired. The changes come after McDonald’s executives conceded they failed to keep up with changing tastes and saw sales slide.

In 2015, guest counts at established McDonald’s locations in the U.S. fell 3 percent. That followed a 4.1 percent drop the previous year. Guest counts declined globally as well during the period.

The latest sales jump in the U.S. marks the best showing since the first quarter of 2012, when comparable-stores sales rose 8.9 percent.

advertisement | advertise on newsday

Sales for the “International Lead” unit, which includes the United Kingdom and Canada, rose 4.2 percent during the period. In the high-growth markets unit, which includes Russia and China, sales climbed 3 percent.

For the three months ended Dec. 31, McDonald’s Corp. earned $1.21 billion, or $1.31 per share. That beat Wall Street expectations for $1.23 per share, according to FactSet.

Total revenue was $6.34 billion, also topping the $6.24 billion analysts expected.