Guards have blocked routes out of China's Wuhan as part of efforts to seal the city and bottle up a new coronavirus as residents scrambled for supplies, clearing out supermarket shelves and queuing up for petrol.
The virus first appeared in the central city of 11 million people last month and is suspected to have jumped to people from an animal in a market where animals were sold illegally.
It has gone on to kill 17 people and infected nearly 600, most in China but cases have been detected as far away as the United States.
The city government said it was suspending all buses, trains, subways, ferries and other long-distance transport as of 10am on Thursday in an effort to keep the virus from spreading.
Flights out of the city, the capital of Hubei province and a major transport hub, were also being suspended, it said.
The transport lockdown comes just before the Lunar New Year when hundreds of millions of people travel home or go on holidays abroad.
The city government made no mention of private vehicles but state media said the provincial government was cutting off Wuhan's highway links.
One resident told Reuters she could not drive out of the city late on Wednesday because guards were blocking the entrance to a highway she hoped to take.
Authorities have advised residents not to leave the city.
Hugo Guo, a 22-year-old university student who returned to Wuhan for the holiday, told Reuters he was resigned to being confined to the city for now but would be keen to get back to his studies in Shanghai.
"I find it acceptable to have to stay at home, but I'm most worried about whether I'll be able to return to school," Guo said by text message.
Footage from state media posted on Twitter showed the city's Hankou railway station nearly empty, its gates barred and the announcement on the suspension of transport posted prominently outside.
People were seen queuing at the station's taxi rank but there did not appear to be many cabs operating.
Flight tracking data showed that some planes were still flying out of the city after 10am, however.
"I'm one of the lucky ones since my flight wasn't actually cancelled," Sibusiso Sgwane, a Wuhan resident who boarded an Air China plane bound for the city of Shenzhen, said in a video message.
"We're advised to wear a mask at all times."
Several Wuhan residents told Reuters people were rushing to stockpile supplies. Big supermarkets were teeming with people and many shelves for staples like meat, vegetables and instant noodles were bare, they said.
"Everyone is on a buying spree," said one Weibo user, showing a picture of long queue at a checkout aisle.
People took to social media to complain about surging prices for vegetables and other groceries.
"No one will object to Wuhan being sealed but you need to let Wuhan's residents be able to eat and live," said another user of the Weibo social media platform.
Posted videos showed long queues at petrol stations. One resident said he had to wait for an hour before he could fuel up his car.
In Beijing, a group of passengers boarded one of the last scheduled flights into Wuhan. One, named Jane, said she was "very uneasy" given the situation but had to go back for her child.
Another passenger, who only identified himself by the surname Yang, said he was not scared to be travelling to Wuhan.
"I'm a brave man," he said.
"It's not like it will be only me."