By Agence France-Presse
The quake was felt in Wellington during a session of parliament, prompting lawmakers to stop deliberations and seek refuge as a precaution.
There were no initial reports of major damage and the quake does not appear to have been strongly felt in Auckland, where the royals had been taking part in a "welly wanging" contest with schoolchildren.
Prime Minister Jacinda Ardern said it was "widely felt across central NZ," despite the epicentre being at a depth of over 200 kilometres (125 miles).
She urged Kiwis to "check on those around you".
The epicentre of the quake was just to the east of Waitara, a coastal town halfway between the North Island cities of Auckland and Wellington.
There were no immediate reports of damage in the nearby coastal town of New Plymouth.
"Apparently some people felt it," a receptionist at a local hotel told AFP.