Same-store sales, or sales at locations open at least a year, jumped nearly 4%. Analysts had predicted a 1% decline.
It was a far different story than the first quarter, when U.S. and global same-store sales slumped and McDonald's said lower- and middle-income consumers were cutting back on fast food.
But a meal tied to “A Minecraft Movie,” which was offered in 100 countries starting in April, drove customers back to stores. McDonald's said it sold out of its collectible figures in less than two weeks.
McDonald's new McCrispy chicken strips also boosted customer traffic after they were added to the menu in May.
McDonald's net income rose 11% to $2.25 billion in the second quarter. Adjusted for restructuring charges and other one-time items, the company earned $3.14 per share. That was in line with Wall Street's forecast.