A rescue operation involving hundreds of tourists and residents is under way in the coastal town of Kaikoura after a powerful earthquake struck New Zealand.
The defence force said it had started ferrying people out by military helicopter and that a navy ship from Auckland is due to arrive in the area on Wednesday morning to assist.
The 7.8-magnitude quake which struck the South Island left two people dead and triggered a small tsunami.
It also brought down rocks and mud that swept across highways and devastated local roads.
Home to about 2,000 residents, Kaikoura is a popular destination for travellers taking part in whale-watching expeditions or wanting a stopover with mountain views. However, the quake knocked out water supplies and sewer systems and left people with no easy way out.
Air Commodore Darryn Webb, acting commander of New Zealand's Joint Forces, said: "From all directions, Kaikoura has essentially been isolated.
"There's a real imperative to support the town because it can't support itself."
Air Commodore Webb said the military was using four NH90 helicopters that could each transport about 18 people at a time out of the town. He said the ship could pick up hundreds of people if weather conditions allowed.
"We're going to get as many people and belongings out as quickly as we can," he said.
The operation could take several days and, if needed, a C-130 military transport plane could drop fuel, water, food and other supplies into the town. He said about five metric tonnes of supplies are ready to be delivered from Christchurch.
Sarah Stuart-Black, director of the ministry of civil defence and emergency management, said the priority was transporting out those people with health issues or international flights booked. She said 34 people had been airlifted out by noon on Tuesday.
She said the community was rallying to help the tourists, saying: "It's fantastic that some of the locals in Kaikoura have taken in tourists into their own homes."
Elsewhere, many people are returning to work in the capital, Wellington, after the quake shut down much of the central city on Monday, although some buildings remained closed and heavy rain and flooding has compounded the difficulties for others.
Strong aftershocks have continued to shake New Zealand, rattling the nerves of exhausted residents.
Police said one person died in Kaikoura and another in Mt Lyford, a nearby ski resort. Several other people suffered minor injuries in Kaikoura, police spokeswoman Rachel Purdom said.
Prime minister John Key flew over Kaikoura by helicopter as aftershocks kicked up dust from the landslides below. Cars could be seen lying on their sides and parts of the road were clearly impassable.
"It's just utter devastation," Mr Key said.
Police stepped up their patrols after receiving several reports of burglaries in homes and businesses that had been evacuated due to the quake. Police said six guns, some of them antiques, were stolen from a home near the town of Nelson.
Three cows whose predicament captured the interest of people around the world after they became stranded on a small island of grass in an area ripped apart by the quake have now been rescued. The Newshub news service reported a farmer and some helpers dug a track to them and brought them out.
New Zealand, with a population of 4.7 million, sits on the "Ring of Fire," an arc of seismic faults around the Pacific Ocean where earthquakes are common. An earthquake in Christchurch five years ago destroyed thousands of homes and buildings and killed 185 people.