North Korea's announcement that it had carried out its first test of a hydrogen bomb was swiftly condemned by its neighbours and other countries around the world. But in the North itself there was jubilation.
United Nations Security Council members will meet in an emergency session later on Wednesday to discuss events.
President Park Geun-Hye hastily convened an emergency national security council meeting as soon as news of the test broke and promised a tough response.
"The test is not only a grave provocation to our national security but also a threat to our future... and a strong challenge to international peace and stability," she said.
Earlier, the government in Seoul said it would "take all necessary measures including additional sanctions by the UN Security Council... so that the North will pay the price for the nuclear test".
In the North, meanwhile, crowds gathered to watch the announcement of the hydrogen bomb test on big screens. Many clapped and cheered.
Kim Sok Chol, 32, watched the TV announcement at train station square, the Associated Press reported.
He told the news agency he did not know much hydrogen bombs, but added: "Since we have it, the US will not attack us. I think the first successful H-bomb test is a great national event."
Ri Sol Yong, a student of 22, said the test "gives us more national pride".
"Thanks to the fact that our country is a nuclear weapons state, I can study at the university without any worries. If we didn't have powerful nuclear weapons, we would already have been turned into the slaves of the US."
Prime Minister Shinzo Abe said the test was "a serious threat to the safety of our nation and we absolutely cannot tolerate this".
"This clearly violates UN Security Council resolutions and is a grave challenge against international efforts for non-proliferation," he said.
China, the main ally of North Korea, said it was firmly opposed to North Korea's latest nuclear test.
"North Korea carried out another nuclear test despite widespread opposition from the international community. Chinese government expresses strong opposition to this," said Chinese foreign ministry spokeswoman Hua Chenying.
"It's China's stance to promote the denuclearisation of the Korea Peninsula, prevent nuclear proliferation and maintain peace and stability in north-east Asia. We strongly urge North Korea to abide by her pledges and stop taking any actions that might make the situation worse."
Chinese state television also aired doubts about whether its neighbour could have tested a hydrogen device.
"There is an extremely big gap between this and the usual strength of hydrogen bombs... data doesn't support suggestions that the bomb was a hydrogen bomb," military expert Du Wenlong said on CCTV.
What is a hydrogen bomb?
- A weapon where the nuclear fusion of hydrogen isotopes creates a rapid release of energy, developed in 1952 by the United States
- Also known as a thermonuclear bomb, it can be much more powerful than atomic weapons that use fission
- Such bombs can be as small as a few feet long and can fit in warheads of ballistic missiles
The White House would not confirm a hydrogen bomb test had been carried out but promised to "respond appropriately to any and all North Korean provocations".
British Foreign Secretary Philip Hammond called the test a "provocation".
"If North Korean H-bomb test reports are true, it is a grave breach of UNSC (UN Security Council) resolutions and a provocation which I condemn without reservation," he wrote on Twitter.
French President Francois Hollande called for a strong reaction from the international community.
"While awaiting confirmation of the characteristics of the nuclear test announced and observed last night in North Korea, France condemns this unacceptable violation of (UN) Security Council resolutions," a statement said.
Russia, another North Korean ally, also condemned the test as a "flagrant violation of international law and existing UN Security Council resolutions".
"Such actions are fraught with the possibility of aggravating the situation on the Korean peninsula, which already has a very high potential for military and political confrontation," it said.
Earlier, Russian TV channels were swift to cast doubt on the test and the North's nuclear capabilities.
"This may be yet another bluff aimed at getting more humanitarian aid and food for the people of North Korea," said NTV.
Foreign Minister Julie Bishop condemned the test "in the strongest possible terms". She said it "confirms North Korea's status as a rogue state and a continuing threat to international peace and security". Australia would call for stronger UN sanctions, she added.
UN Secretary General Ban Ki-moon
Mr Ban said the underground nuclear test was "deeply troubling".
"This test once again violates numerous Security Council resolutions despite the united call by the international community to cease such activities. It is also a grave contravention of the international norm against nuclear testing," he told reporters.
"This act is profoundly destabilising for regional security and seriously undermines international non-proliferation efforts. I condemn it unequivocally."
North Korea and nuclear weapons
October 2002: North Korea first acknowledges it has a nuclear weapons programme
October 2006: The first of three underground nuclear explosions is announced, at a test site called Punggye-ri
May 2009: A month after walking out of international talks on its nuclear programme, North Korea carries out its second underground nuclear test
February 2013: A third nuclear test takes place using what state media calls a "miniaturised and lighter nuclear device"
May 2015: Pyongyang claims to have tested a submarine-launched missile, which is more difficult to detect than conventional devices
January 2016: North Korea says it has successfully tested a hydrogen bomb