Social media footage showed water washing through a church and several homes, and witnesses said ash was falling over the capital, Nuku’alofa.
A tsunami warning sent residents scrambling to higher ground.
The eruption of the Hunga Tonga-Hunga Haʻapai volcano was heard across the South Pacific, reportedly as far as New Zealand and Australia.
Tonga’s capital lies just 65km north of the volcano, on the country’s main island of Tongatapu.
One Tonga resident, Mere Taufa, said the eruption hit as her family was preparing for dinner, and her younger brother thought bombs were exploding nearby.
“My first instinct was to take cover under the table, I grabbed my little sister, and screamed at my parents and others in the house to do the same,” New Zealand news site Stuff.co.nz quoted her as saying.
Ms Taufa said the next thing she knew, water was rushing into their home.
“You could just hear screams everywhere, people screaming for safety, for everyone to get to higher ground,” she added.
The plumes of gas, smoke and ash pouring from the volcano reached 20km into the sky, Tonga Geological Services said.
Prof Shane Cronin, a volcanologist at the University of Auckland, said the eruption was one of the biggest in Tonga in the past 30 years.
“This is a pretty big event – it’s one of the more significant eruptions of the last decade at least,” he told the BBC.
“The most remarkable thing about it is how rapidly and violently it’s spread. This one was larger, a much wider lateral spread, much more ash was produced. I expect there to be many centimetres of ash that have been deposited on Tonga.”
The initial eight-minute eruption was so violent it could be heard as “loud thunder sounds” in Fiji, more than 800km (500 miles) away, according to officials in the capital, Suva. The Fijian Government has issued a tsunami advisory and opened evacuation centres for people in low-lying coastal areas.
Vanuatu, another island nation in the Pacific, issued a similar warning.
A spokesperson for the Australian government, said the prime minister and minister for foreign affairs are monitoring the situation and ready to provide support on request.
A tsunami warning has been issued for parts of Australia’s east coast and Tasmania.
Authorities told people in the eastern state of New South Wales to “get out of the water and move away from the immediate water’s edge”.
In New Zealand, which is more than 2,300km away from Tonga, the National Emergency Management Agency said coastal areas on the north and east coast of the North Island could see “strong and unusual currents and unpredictable surges at the shore”.
Local forecaster Weather Watch tweeted about the eruption: “The energy release is simply astonishing”, adding: “Reports of people hearing the sonic booms across New Zealand.” (Courtesy BBC)