(Reuters) - McDonald's Corp MCD.N reported strong restaurant sales on Tuesday, as $1 sodas and build-your-own burgers helped it draw in more customers and beat back rivals in an intense battle for market share.

The world's largest restaurant chain by revenue has been working to boost flagging traffic at its U.S. restaurants, where it gets most of its profit, after customers defected to fast-food rivals and pricier fast-casual options like Chipotle Mexican Grill Inc CMG.N.

In the past year, McDonald’s has introduced cook-to-order, fresh beef Quarter Pounders and new items with a variety of buns and sauces like the Signature Sriracha sandwich, along with mobile ordering and delivery.

“We served more customers, more often,” Chief Executive Officer Steve Easterbrook said on a conference call to discuss third-quarter earnings. “The U.S. business regained its stride.”

Some analysts on the call expressed concern that new efforts, including table service and made-to-order burgers, would mean longer wait times that would annoy diners, but executives said customer satisfaction was higher and any service issues would be quickly ironed out.

Global sales at restaurants open at least 13 months rose 6 percent for the quarter, posting the third straight quarterly traffic increase and beating the 4.5 percent gain expected by analysts polled by research firm Consensus Metrix.

Those sales rose a better-than-expected 4.1 percent in the United States, where traffic improved for the second quarter in a row after more than four straight years of declines. China, the UK and Canada also turned in strong performances.

“Given that the fast food and casual dining segments as a whole struggled over the third quarter, this is an encouraging set of results which suggests McDonald’s is gaining both market and customer share,” GlobalData Retail’s Managing Director Neil Saunders said.

McDonald’s shares were up 1 percent at $165 in midday trading, flirting with their record high on Friday.

Aggressive U.S. promotions included $1 any-size soft drinks, $2 McCafe smoothies and espresso drinks and McPick 2 offers of two items for $5.

The changes, part of a turnaround plan under CEO Easterbrook, came as McDonald's catches up with Chipotle, Wendy's Co WEN.O and other chains that raised the bar for what consumers can expect from quick-serve restaurants.

The logo of a McDonald's Corp restaurant is seen in Los Angeles, California, U.S. October 24, 2017. REUTERS/Lucy Nicholson

McDonald’s shares have climbed 65 percent since Easterbrook was named CEO in March 2015, well ahead of Wendy’s 37 percent gain and nearly triple the S&P 500’s rise over the same period.

Chipotle shares meanwhile have plunged 52 percent following a string of food safety lapses in 2015.

McDonald’s shares may have more scope for gains, as the company’s price-to-earnings ratio is still far below many peers, according to Thomson Reuters data.

Many fast-casual chains have fallen short of expectations following a wave of initial public offerings in recent years. Shares in Zoe's Kitchen Inc ZOES.N and Noodles & Co NDLS.O are trading below their IPO prices, while Shake Shack Inc SHAK.N is far below its record high of nearly $93 in May 2015.

Lower priced fast-food chains seem to be benefiting from last year’s sharp slowdown in customer traffic to fast-casual chains, Bernstein analyst Sara Senatore said in a recent report.

“I think it’s safe to say that the reports of fast food’s death were greatly exaggerated,” said Senatore, who added that fast-food chains have posted the best fundamental results and stock returns of the broader industry since late 2015.

During the call, analysts called out concerning trends in service times and U.S. labor costs.

Executives said service speeds initially slow slightly, roughly 5 seconds, at its modernized “experience of the future” restaurants that offer kiosk and mobile ordering, curbside pickup, table service, custom sandwiches and cook-to-order burgers.

“We expect to claw that back” as crews get more experienced, McDonald’s USA President Chris Kempczinski said.

Every second counts in the fast-food business. Service times at McDonald’s drive-throughs, which account for 70 percent of U.S. revenue, already lag those of some major rivals.

Excluding items, McDonald’s earned a profit of $1.76 per share, missing the average analyst estimate by a penny, according to Thomson Reuters I/B/E/S.

During the quarter, McDonald’s had higher taxes and expenses, but also had gains from selling its China and Hong Kong businesses.

Total revenue fell 10 percent to $5.75 billion, due to restaurant sales to franchisees and strategic partners.