NEW YORK—McDonald’s Corp. is getting customers back into its restaurants after years of declining traffic, helped by drink deals and more upscale burgers.

The company saw an increase in U.S. diners last quarter — a key milestone that has proved elusive to chief executive officer Steve Easterbrook — and posted same-store sales that handily beat analysts’ estimates. The shares rose the most in three months, hitting a record high.

The results mark a victory for the 49-year-old CEO, who has been working to overhaul McDonald’s for the past two years. Even after he managed to increase sales at the world’s largest restaurant chain — helped by higher prices — it’s taken longer to get more people in the door.

Read more:

McDonald’s targets falling customer visits with drive-thru app and delivery

McDonald’s to start using fresh beef at most U.S. locations

McDonald’s pushes for kitchen upgrades to win back customers

“You can increase sales by raising prices, but that’s not sustainable,” said Michael Halen, an analyst at Bloomberg Intelligence. “This is good, strong, sustainable growth.”

As many of its fast-food competitors struggle, McDonald’s has boosted sales with cheaper drinks, all-day breakfast and higher quality chicken. The chain is also improving kitchen equipment to make its food taste better. Same-store sales rose for the eighth-straight quarter, and its domestic gain of 3.9 per cent beat analysts’ estimate of 3.2 per cent.

Taking notice

Easterbrook, who took over in March 2015, also has contended with a record run of grocery deflation that has made restaurants a tougher sell to many Americans. Chains have had to work harder to compete with supermarkets, where eggs and other staples are increasingly cheap.

McDonald’s, with its promotions and better food, is persuading more customers to eat out — or attracting them away from rival restaurants, Easterbrook said on a conference call.

“It’s a market-share fight and everyone is working hard to up their game,” he said. “Our gain will result in pain being felt elsewhere.”

Second-quarter revenue amounted to $6.05 billion (U.S.), beating the average analyst estimate of $5.96 billion. Earnings rose to $1.70 a share, compared with a projection of about $1.62.

Globally, same-store sales gained 6.6 per cent, well ahead of the 4 per cent predicted by analysts, according to Consensus Metrix.

McDonald’s traffic had dropped domestically for the past four years. While Oak Brook, Ill.-based McDonald’s posted surprisingly strong sales in the first quarter, customer counts were still negative.

Loading... Loading... Loading... Loading... Loading... Loading...

In March, company executives said McDonald’s had lost over 500 million transactions in its home market since 2012. Most of those customers defected to other traditional fast-food competitors, not fancier or fast-casual chains such as Chipotle Mexican Grill and Panera Bread, according to company officials.

McDonald’s sees delivery services and digital ordering options as the key to attracting more diners. It hasn’t been easy. U.S. competitors are advertising steeply discounted food and new fare. In response, Easterbrook has tried to overhaul the company’s menu and added all-day breakfast in the U.S. in 2015.