North Korea today risked further international isolation after it claimed to have successfully tested a nuclear weapon as powerful as the atomic bomb that destroyed Hiroshima.
The test comes less than two months after the North enraged the US and its allies by test firing a long-range ballistic missile.
The KNCA news agency, the regime's official mouthpiece, said: "We have successfully conducted another nuclear test on 25 May as part of the republic's measures to strengthen its nuclear deterrent."
Officials in South Korea said they had detected a tremor consistent with those caused by an underground nuclear explosion. The country's Yonhap news agency reported that the North had test fired three short-range missiles immediately after the nuclear test from a base on the east coast.
The underground atomic explosion, at 9.54am local time, created an earthquake measuring magnitude 4.5 in Kilju county in the country's north-east, reports said.
President Barack Obama called the test a matter of grave concern to all countries. "North Korea is directly and recklessly challenging the international community," Obama said in a statement. "North Korea's behaviour increases tensions and undermines stability in north-east Asia."
The UN security council will hold an emergency meeting in New York later today to discuss its response to the latest escalation in the crisis. Obama and other leaders did not offer details on the council's possible response.
China, North Korea's key ally, said it was "resolutely opposed" to the test, urging its neighbour to avoid actions that would sharpen tensions and return to six-party arms-for-disarmament talks.
Japan, which considers itself high on the North's potential hit list, said it would seek a new resolution condemning the test.
Russian defence experts estimated the explosion's yield at between 10 and 20 kilotons, many times more than the 1 kiloton measured in its first nuclear test in 2006 and about as powerful as the bombs the US used against Hiroshima and Nagasaki at the end of the second world war. One kiloton is equal to the force produced by 1,000 tons of TNT.
The force of the blast made the ground tremble in the Chinese border city of Yanji, 130 miles away.
The North Korean news agency said the test had been "safely conducted on a new higher level in terms of its explosive power and technology of its control. The test will contribute to defending the sovereignty of the country and the nation and socialism and ensuring peace and security on the Korean peninsula and the region."
Gordon Brown described the test as "erroneous, misguided and a danger to the world". The prime minister added: "This act will undermine prospects for peace on the Korean peninsula and will do nothing for North Korea's security.
South Korea and Japan condemned the test, North Korea's second since it exploded its first nuclear device in October 2006 in defiance of international opinion. That test prompted the UN security to pass a resolution banning Pyongyang from activities related to its ballistic missile programme.
The South Korean president, Lee Myung-bak, convened a session of the country's security council after seismologists reported earthquakes in the Kilju region, site of the North's first nuclear test.
In Tokyo, Japan's chief cabinet secretary, Takeo Kawamura, said the test was "a clear violation of the UN security council resolution and cannot be tolerated".
North Korea had warned of a second nuclear test after the UN condemned its test-launch of a ballistic missile on 5 April and agreed to tighten sanctions put in place in 2006.
Pyongyang insisted it had put a peaceful communications satellite in orbit, but experts said the technology and methods were identical to those used to launch a long-range Taepodong-2 missile.
After the UN refused to apologise for condemning the launch, North Korea expelled international inspectors, threatened to restart its Yongbyon nuclear reactor - which it had agreed to start dismantling in 2007 - and walked away from six-party nuclear talks.
Today's test will add to fears that the North is moving closer to possessing the ability to mount a nuclear warhead on long-range missiles that are capable, in theory, of reaching Hawaii and Alaska.
"This test, if confirmed, could indicate North Korea's decision to work at securing actual nuclear capabilities," Koh Yu-hwan, a professor at Dongkuk University in Seoul, told Reuters.
"North Korea had been expecting the new US administration to mark a shift from the previous administration's stance, but is realising that there are no changes. It may have decided that a second test was necessary. [It] seems to be reacting to the US and South Korean administrations' policies."
Analysts believe the North Korean leader, Kim Jong-il, hopes to use the test to shore up support from the military amid mounting speculation that he is about to name one of his three sons as his successor.
Kim, 67, appears to be re-establishing his grip on power since reportedly suffering a stroke last August. Today's test is a direct challenge to attempts by Obama to engage the North and stem the spread of nuclear weapons.
Despite promising a fresh start to bilateral relations, Obama, who denounced last month's missile launch as "a provocation," has so far failed to persuade North Korean to enter into negotiations.
Kim Myong-chol, executive director of the Centre for Korean-American Peace in Tokyo, who is close to Pyongyang, said the test was a reminder that North Korea "is going it alone as a nuclear power".
"North Korea doesn't need any talks with America. America is tricky and undesirable," he said. "It does not implement its own agreements.
"We are not going to worry about sanctions. If they sanction us, we will become more powerful. Sanctions never help America; they are counter-productive ... We don't care about America and what they say."