Shareholders of Domino's (NYSE:DPZ) were optimistic heading into its second-quarter earnings report. But the pizza delivery giant still trounced those high expectations. Sales growth held up through late June even as consumers flocked back to restaurants and ramped up their time spent away from home.

The good news flowed right down to the bottom line, too. Earnings and cash flow surged compared to last year.

Friends sharing a delivery pizza at home.

Image source: Getty Images.

Growing quickly

Domino's notched another quarter of growth, which is no surprise considering it has expanded sales each quarter in the U.S. for more than a decade. But the scale of its gains was impressive considering the pandemic's impact today and in the prior-year period.

Revenue rose 4% in the mature U.S. market and jumped 14% internationally. Those wins translated into 12% higher revenue compared to the 6% uptick that most investors were expecting.

And that growth figure indicated almost no slowdown compared to a year earlier, when Domino's was enjoying some of the biggest demand lifts from the early phases of the pandemic. Sales are now up 20% in the past two years in the U.S., and up 15% in that period internationally. "I am very pleased with our strong global retail sales and store growth momentum," CEO Ritch Allison said in a press release.

Store gains

Executives like to point investors toward store closings as a key metric to follow in judging the health of the business. Domino's shined in that department in the second quarter, with 39 openings in the U.S. and just 4 closings off of its base of 6,400 locations.

Worldwide, the chain opened 256 delivery and carryout hubs while closing just 18. That performance was good enough to push Domino's over 18,000 locations, compared to 16,000 at the start of 2019.

DPZ Cash from Operations (TTM) Chart

DPZ cash from operations (TTM) data by YCharts. TTM = trailing 12 months.

These franchisees are enjoying some of their best returns yet. Gross profit margin is up and operating margin jumped to 39.5% of sales compared to 38.8% a year ago. Operating cash flow is up to almost $300 million over the last six months from $212 million last year.

Finances and the outlook

Management was busy on the capital allocation front, taking on new debt and using some of that cash to dramatically scale up its stock buybacks. Executives also issued a new repurchase plan after exhausting Domino's prior $1 billion program.

Looking ahead, the company is facing intense competition in the delivery niche, with rivals inside and outside the fast-food pizza segment all looking to steal its market share. Domino's is aiming to stay ahead of the pack with innovations like its recent car-side service launch that allows it to compete for drive-thru business.

The chain's biggest advantages are its financial efficiency and high customer satisfaction rates, and both of these factors are only getting stronger so far in 2021. That's why investors can expect further positive returns from holding this stock over the long term.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.