A tsunami warning has been issued for places within 300km of the epicentre, including the capital, Nuku'alofa.