By Heather Haddon

McDonald's Corp. said same-store sales in the U.S. fell 5% annually in May, a big improvement on the double-digit loss posted a month earlier at the height of domestic lockdowns to combat the new coronavirus.

The burger giant said Tuesday that its drive-throughs and takeaway service had helped it regain much of the ground lost in April, when same-store sales fell 19% annual. The improvement came despite just about 1,000 of McDonald's 14,000 U.S. restaurants having restored dine-in service with reduced seating. Nearly 95% of the chain's U.S. locations have drive-throughs, the company said.

"I am confident in our ability to manage through the immediate challenges and emerge from this pandemic in a position of competitive strength," Chief Executive Chris Kempczinski said.

Chains with drive-throughs are weathering the pandemic better than casual-dining chains and independent restaurants without those means of sales. Surveys show that consumers generally feel that ordering from a drive-through is one of the safest ways to engage with restaurants while the virus continues to spread.

Carrols Restaurant Group Inc., the largest U.S. Burger King franchisee, said Monday that sales at its burger restaurants were up nearly 3% in the week ended June 7 compared with the previous year. Sales had fallen 34% in the week ended March 29, after the pandemic hit. Drive-through sales accounted for much of the recovery.

Still, fast-food chains are struggling with overall declines in the number of customers visiting their stores, particularly in the mornings. Breakfast orders fell 18% at major restaurant chains in the week ended June 7 compared with last year, the worst decline of any part of the day, according to market researcher NPD Group Inc.

McDonald's said breakfast sales and morning guest counts remained negative. Starbucks Corp. said last week that its key morning business remains depressed because of the ways the virus has undone normal commuter and meal patterns, particularly in urban markets.

"It is that morning peak in those particular markets that will be more challenging to recover for Starbucks," Chief Financial Officer Pat Grismer said.

McDonald's and other U.S. chains with global footprints also continue to suffer in international markets that have mandated store closures. Same-store sales in McDonald's internationally operated markets were down 41% in May, when closures in countries including the U.K. and France weighed on sales.

Yum Brands Inc. said last week that its global same-store sales declined 19% in the quarter-to-date through May, mostly because of double-digit declines internationally at its KFC, Pizza Hut and Taco Bell locations because of closures. Sales in the U.S. at those chains, by comparison, were positive during the period.

Write to Heather Haddon at heather.haddon@wsj.com