CHICAGO — A recent McDonald’s marketing campaign involving Grimace, the fast-food chain’s decades-old, fuzzy purple mascot, spun into a “viral phenomenon” contributing to double-digit comparable sales growth in the United States during the latest quarter, executives said.

A key part of the promotion, a limited-edition purple milkshake, sparked a TikTok trend notching several billion views, said Christopher J. Kempczinski, president and chief executive officer of Chicago-based McDonald’s Corp.

“We took the nostalgic experience of celebrating birthdays at McDonald’s and repackaged it for a new generation with none other than Grimace at the center,” added Ian F. Borden, global chief financial officer, during a July 27 earnings call with securities analysts. “It quickly became one of our most socially engaging campaigns of all time with millions of reactions on our social media posts, a true demonstration of how the power of our brand emerges in organic and creative ways in our fans.”

Net income for the second quarter ended June 30 increased 94% to $2.31 billion, equal to $3.15 per share on the common stock, from $1.19 billion, or $1.60 per share, in the year-ago period. Results in the current quarter included pre-tax restructuring charges of $18 million, while results in the prior-year quarter included pre-tax charges of $1.15 billion related to the sale of the company’s Russia business, a pre-tax gain of $271 million related to the sale of the Dynamic Yield business, and a $37 million non-operating expense related to the settlement of a tax audit in France. Excluding special items, McDonald’s adjusted net income increased 23% to $2.32 billion from $1.9 billion, reflecting strong operating performance driven by higher sales-driven franchised margins, according to the company.

Revenues totaled $6.5 billion, up 14% from $5.7 billion in the prior year.

Comparable sales in the US market grew 10%, benefiting from strategic menu price increases and positive comparable guest count growth. Management credited restaurant-level execution, brand marketing and continued digital and delivery growth as contributors to the performance. Mr. Kempczinski said consumer sentiment is showing modest improvement, “but we're certainly still far off of where we were back in 2019.”

 “If you look at incomes under $100,000, we’re actually doing quite well there, which suggests that we’re getting some benefit from trade down, from things like full-service dining, casual dine, etc.,” he said. “And then even if you go to incomes of $45,000 and less, our business is performing well there. What we’re seeing with that group is we are seeing a little bit of a decrease in order size. But it’s being offset by a very strong or continued strength in traffic.”

Comparable sales in international operated markets increased 12%, led by strong comparable sales in Germany and the United Kingdom. In international developmental licensed markets, comparable sales grew 14%, with positive performance in China.

McDonald’s is seeing “early benefits” from efforts to become faster, more innovative and more efficient as an organization, Mr. Kempczinski said, describing the company’s new initiative “to reimagine how we work to bring the full breadth of McDonald’s skills and experiences together to come up with the best solutions that can be scaled.”

Another key to continued momentum is new restaurant development, according to management, which earlier this year announced plans to build its first new units in the United States in more than eight years.

“Our strong performance and strength of our brand has earned us the right to begin accelerating the pace of restaurant openings in our major markets over the next several years,” Mr. Kempczinski said. “While our primary focus is on opening traditional units, we are always testing and learning new ways to meet the needs of our customers.”

An example is a takeaway-only restaurant in Fort Worth, Texas, that opened last year and is “considerably smaller than a traditional restaurant and, as the way customers order and receive their food has changed dramatically over the past few years, is geared toward customers based on their need state wherever they are,” Mr. Kempczinski said. The company’s new business ventures team is testing a small-format concept “with all the DNA of McDonald’s but its own unique personality,” he said. The rapid adoption of digital and delivery orders has created new opportunities for real estate sites “that previously would have been sort of off-limits to us,” Mr. Kempczinski said.

For the six months ended June 30, net income of $4.11 billion, or $5.60 per share, was up 79% from $2.29 billion, or $3.08, in the comparable period. Adjusted net income rose 18% to $4.26 billion from $3.6 billion. Revenues advanced 9% to $12.4 billion from $11.38 billion.