The UN Security Council has opened emergency talks on North Korea's nuclear test, as world powers made calls for swift action against Pyongyang.
The 15-nation council passed a resolution last month threatening "significant action" against North Korea in the event of a new nuclear test or missile launch.
The meeting comes after North Korea confirmed on Tuesday that it carried out a third nuclear test. Monitoring agencies had earlier reported an "unusual seismic event".
"A third nuclear test has been successfully staged," the North's state-run Korean Central News agency said.
"The nuclear test was conducted as part of measures to protect our national security and sovereignty against the reckless hostility of the United States that violated our republic's right for a peaceful satellite launch."
North Korea's ambassador to China was summoned to explain the nuclear test
At just before midday local time, an earthquake with a magnitude of 4.9 was detected just north of a site where Pyongyang conducted earlier nuclear tests.
The two previous tests, in 2006 and 2009, prompted quakes of 3.6 and 4.5 respectively.
The South Korean defence ministry, which raised its military alert level after the quake, said the blast had an explosive yield of between six and seven kilotons (kt) and was of "enormous destructive power".
In comparison, the nuclear weapons detonated above Hiroshima and Nagasaki in 1945 carried estimated yields of 15kt and 22kt respectively.
An activist defaces a poster of Kim Jong-un and his wife Ri Sol-ju
Prior to the Security Council meeting a spokesperson for the UN boss Ban Ki-moon said: "The Secretary-General condemns the underground nuclear weapon test conducted by the Democratic People's Republic of Korea today.
"It is a clear and grave violation of the relevant Security Council resolutions."
Tibor Toth, the executive secretary of the Preparatory Commission for the Comprehensive Nuclear Test Ban Treaty Organisation (CTBTO), said the event's location was "roughly congruent with" nuclear tests carried out by North Korea in 2006 and 2009.
"This act would constitute a clear threat to international peace and security, and challenge efforts made to strengthen global nuclear disarmament and non-proliferation, in particular by ending nuclear testing," he added.
A Japanese seismic official shows where the blast occurred
China expressed its "firm opposition" to North Korea's nuclear test, saying its wayward ally had gone ahead with the blast "despite widespread opposition from the international community".
"We strongly urge the DPRK to honour its commitment to denuclearisation, and not to take any actions which might worsen the situation," the foreign ministry said in a statement posted on its website.
US President Barack Obama said the test posed a threat to international peace and security.
A North Korean soldier stands guard after the test
On Tuesday morning the Foreign and Commonwealth Office said: "The UK will begin urgent consultations with Security Council partners calling for a robust response to this latest development."
Mr Obama said the US will "continue to take steps necessary to defend ourselves and our allies" and it will work with other nations "to pursue firm action".
He added that North Korea's action "warrants further swift and credible action by the international community".
Foreign Secretary William Hague said: "North Korea's development of its nuclear and ballistic missile capabilities poses a threat to international and regional security.
Protesters in Seoul shout anti-North slogans
"Its repeated provocations only serve to increase regional tension, and hinder the prospects for lasting peace on the Korean peninsula."
The Russian foreign ministry said: "By implementing a new nuclear test, Pyongyang once again ignored the rules of international law and has shown disregard UN Security Council resolutions.
"There is an urgent need to create an effective system of regional peace, which would be based on the principle of undiminished security for all participants in accordance with multilateral commitments on denuclearisation of the Korean peninsula."
South Korean troops march along the demilitarised zone at the 38th parallel
Japan said the test was a "grave threat" that "cannot be tolerated".
After the blast took place a North Korean newsreader urged the Korean People's Army (KPA) to prepare for combat against its foes.
She stressed that if an order was given "the KPA should blow up the stronghold of aggression at a strike".
"And wipe out the brigandish US imperialists and South Korea puppet army to the last man and thus accomplish the historic cause of national reunification."