There was a potential tsunami threat but its severity was still being assessed, Radio New Zealand reported.
People in some coastal areas were told to go to higher ground, it added.
However, the Pacific Tsunami Warning Center in Hawaii tweeted that there was no tsunami threat, with only a 21cm (8in) wave measured.
The quake occurred at 04:37 local time (16:37 GMT) at a depth of 19.1 miles, US monitors say.
Residents across North Island said they felt shaking and rattling as the quake struck but there were no immediate reports of serious damage.
In 2011, the city of Christchurch on South Island was devastated by a magnitude 6.3 earthquake that left 185 people dead.
Each year more than 15,000 earthquakes are recorded in New Zealand, but only about 150 are large enough to be felt.
More about:






