Generous colleagues helped out seven U.S. Marines at the U.S. consulate in Shanghai who were running out of fresh food because of a strict coronavirus lockdown, according to posts in private consulate message groups.

Shanghai has been hit by food shortages as the citywide lockdown puts pressure on delivery staff amid surging COVID-19 numbers.

A U.S. consulate employee issued a plea on the WeChat platform on Tuesday for staff to spare some food for the Marines. He was not acting in an official capacity, a person with knowledge of the matter said.

"Marines have depleted their food and can no longer get delivery," the employee told colleagues living in Shanghai.

The Marines only had vacuum-sealed rations left, the employee said in the message, seen by Reuters and verified by two people.

"I know we are all running short on supplies. If you can spare a meal's worth or two for 7 extra mouths, they'd be very appreciative," the employee said.

Staff responded with supplies, a person said in a later message, adding: "The marines are beyond thankful."

The U.S. consulate in Shanghai declined to comment on the Marines and their rations.

"We are actively working with and assisting our citizens experiencing disruptions related to recent COVID-19 outbreaks in China," the mission said in a statement.

Marines guard U.S. diplomatic missions around the world.

Many Shanghai residents have been waking at dawn to work the phones in the hope of securing food supplies from over-subscribed delivery apps.

Some shoppers say the only way to get an order in is for everyone in the family to click "buy" on their phones at the same time, and even then, some families can't secure a delivery for up to four days, several city residents said.