The tsunami warnings from the latest New Zealand earthquake show how important it is for people to be prepared for such an event.
The early messages from New Zealand's Ministry of Civil Defence and Emergency Management (MCDEM) on its Twitter account @NZcivildefence said it was "assessing whether there is any tsunami threat", but just 30 minutes later it changed this advice to say a tsunami was "possible".
So why was the message changed, and what can we learn from it?
New Zealand is in a very active earthquake zone and the risk of tsunami is high along almost every part of the coastline. Tsunamis are usually generated by the largest earthquakes, of about magnitude 7 or above.
If an earthquake of this size is detected, emergency management services will send out an immediate warning to give people in risk areas the maximum amount of time to evacuate.
But it can take several hours to work out the exact location and magnitude of an earthquake, so emergency services will continually update their message when new information becomes available.
In the case of the recent earthquake and tsunami in New Zealand, the first reports suggested the earthquake had a magnitude of 6.5, below that expected to generate a tsunami.
It also looked like the earthquake occurred onshore, which again lowered the risk of a tsunami. That's probably why the MCDEM, which is responsible for alerting the New Zealand public of any tsunami risk, initially sent out a tweet saying it was only assessing any tsunami threat.
This would have been based on the best available information at the time.
But in the minutes following the quake, the estimates of its magnitude were raised to 7.5, meaning that there was real risk of a tsunami. A tsunami wave was measured at Kaikoura, on the east coast of the South Island, only minutes after the earthquake.
This would have prompted authorities to make a rapid change to the tsunami warning status. Messages were immediately sent out via Twitter and other means to warn of the tsunami risk.
Tsunami waves of 2.5m were measured at Kaikoura, 1m at Christchurch, and 0.5m at Wellington. The tsunami wave reached the Chatham Islands, 800km east of New Zealand, in about 4 hours, and was measured at Easter Island after 12 hours.
A warning was eventually issued for all of New Zealand's coasts.
The tsunami threat is for the entire NZ coastline. Stay off beaches. First waves have arrived but may not be the largest. pic.twitter.com/dVLM2w5Pxy— MCDEM (@NZcivildefence) November 13, 2016
This was then gradually downgraded over the next few hours as the tsunami threat passed.
Although the threat from tsunami waves has passed, unpredictable currents can affect beaches for many days following a tsunami, so people are usually warned to stay out of the water.
Land quake, sea tsunami
So how was a tsunami generated by an earthquake with its epicentre onshore?
Most tsunamis are generated when a fault ruptures on the sea floor, rapidly pushing up a wall of water which then moves outwards as a wave. When an earthquake occurs on land there is far less risk of this happening.
The Kaikoura Canyon just offshore from Kaikoura has very steep, unstable sides with a lot of loose sediment. During an earthquake this sediment can fall into the canyon, displacing water and generating a tsunami wave.
We already know that large landslides did occur onshore to the north and south of Kaikoura. It is highly likely that landslides also occurred in the deep water of the Kaikoura Canyon, and that this is what caused the tsunami.
The first lesson to learn from this is that tsunamis can often strike the coast with very little warning, and people in high-risk zones need to act quickly when an earthquake occurs and not wait for official warnings.
The second lesson is that despite the incredible technology we now have to measure earthquakes and tsunamis, there are still limits on how quickly we can accurately measure and locate an earthquake and assess the likely tsunami risks. Events such as Monday's, where the earthquake likely triggered a submarine landslide, make it even harder to quickly calculate the tsunami risk.
Earthquakes and tsunamis are unpredictable although our understanding of the science is improving all the time.
But it takes time to get accurate information to the public after an earthquake and tsunami, so those living closest to the hazard zones need to be aware of natural warning signs and not rely only on official warning messages.