The east coast of New Zealand was hit by a powerful 7.1 magnitude earthquake before dawn on Friday, generating a small tsunami, but officials said there was no significant damage or injuries.
A swarm of aftershocks, several of nearly 6.0 magnitude, rocked the region for many hours after the initial jolt as coastal residents made their way to high ground by torchlight.
But less than three hours later they were advised they could return home after a 30-centimetre (one foot) tsunami was detected.
"The greatest wave height has already occurred, further waves are anticipated to be up to 20 centimetres," the Civil Defence organisation, which is responsible for national emergency management, said.
"Areas under 'marine and beach threat' can expect unusually strong currents and unpredictable water flows near the shore. This means a threat to beach, harbour, estuary and small boat activities."
However, despite the power of the temblor, East Coast Civil Defence information officer Sheridan Gundry told Radio New Zealand the impact was minimal.
"We haven't heard any reports of injuries or damage at all," she said.
"There was power out in a few places but we've been let off pretty lightly as far as damage goes."
The tsunami warning covered the East Coast of the North Island and the upper South Island.
The shallow tremor, off the coast of New Zealand, was estimated at a depth of around 30 kilometres (18 miles), according to the US Geological Survey.
It struck at 4:37am (1637 GMT) and was centred 167 kilometres (103 miles) from the nearest main town, Gisborne, which has a population of around 45,000.
In New Zealand, where earthquakes are common, Civil Defence regularly holds practice drills for coastal residents so they know how to react in an emergency.
Pat Seymour, a local council politician in the Gisborne area, told the New Zealand Herald the earthquake was "quite vigorous".
"It was enough to make me stand in the doorway," she said, recalling what she had been taught.
In Te Araroa, nearly the entire population of 600 left their homes for higher ground according to local Iain Fraser.
"It was pretty severe shaking for a couple of minutes. Then a couple of very light tremors after that," he said. "I'm actually 1,000 metres from the ocean but I'm up off sea level. I'm looking like the only one left in town at the moment."
In nearby Tokomaru Bay, Marlene Kipa heard the civil defence warning sirens and her mind went to other disasters.
"That did cross my mind -- the Christchurch earthquake -- I wondered how they feel."
In February 2011, a 6.3 earthquake left 185 people dead in the South Island city of Christhurch.
New Zealand is on the boundary of the Australian and Pacific tectonic plates, which form part of the so-called "Ring of Fire", and experiences up to 15,000 tremors a year.