The U.S. Geological Survey said the earthquake hit a spot about 873 kilometers (541 miles) northeast of Ngunguru, New Zealand, a town of about 1,400 people. It occurred at a depth of 10 kilometers (6 miles).
The area the quake struck is called the Kermadec Islands, about 800 kilometers (497 miles) northeast of New Zealand's North Island.
New Zealand's Ministry of Civil Defense and Emergency Management cleared New Zealand of a tsunami threat moments after issuing a beach warning.
The Kermadec Islands, a volcanic archipelago, are prone to earthquakes. The islands are a dependency of New Zealand and lie at the western edge of the Kermadec Trench.
There are no permanent settlements on the islands.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.