There were no immediate reports of injuries or the extent of the damage as communications with the small nation remained problematic. Video posted to social media showed large waves washing ashore in coastal areas, swirling around homes and buildings.
New Zealand's military said it was monitoring the situation and remained on standby, ready to assist if asked.
Satellite images showed a huge eruption, a plume of ash, steam and gas rising like a mushroom above the blue Pacific waters.
The Tonga Meteorological Services said a tsunami warning was in effect for all of the archipelago, and data from the Pacific Tsunami Warning Center showed waves of 80 centimeters (2.6 feet) had been detected.
Residents of American Samoa were alerted of the tsunami warning by local broadcasters as well as church bells that rang territory-wide. An outdoor siren warning system was out of service. Those living along the shoreline quickly moved to higher ground.
As night fell, there were no reports of any damage and the Hawaii-based tsunami center canceled the alert.
Authorities in the nearby island nations of Fiji and Samoa also issued warnings, telling people to avoid the shoreline due to strong currents and dangerous waves. The Japan Meteorological Agency said there may be a slight swelling of the water along the Japanese coasts, but it was not expected to cause any damage.
The Islands Business news site reported that a convoy of police and military troops evacuated Tonga's King Tupou VI from his palace near the shore. He was among the many residents who headed for higher ground.
The explosion of the Hunga Tonga Hunga Ha’apai volcano was the latest in a series of spectacular eruptions.
A Twitter user identified as Dr. Faka’iloatonga Taumoefolau posted video showing waves crashing ashore.
“Can literally hear the volcano eruption, sounds pretty violent,” he wrote, adding in a later post: “Raining ash and tiny pebbles, darkness blanketing the sky.”
Earlier, the Matangi Tonga news site reported that scientists observed massive explosions, thunder and lightning near the volcano after it started erupting early Friday. Satellite images showed a 5-kilometer (3 mile) -wide plume rising into the air to about 20 kilometers (12 miles).
More than 2,300 kilometers (1,400 miles) away in New Zealand, officials were warning of storm surges from the eruption.
The National Emergency Management Agency said some parts of New Zealand could expect “strong and unusual currents and unpredictable surges at the shore following a large volcanic eruption.”
The volcano is located about 64 kilometers (40 miles) north of the capital, Nuku’alofa. Back in late 2014 and early 2015, a series of eruptions in the area created a small new island and disrupted international air travel to the Pacific archipelago for several days.
Tonga is home to about 105,000 people.