North Korea said it has carried out a successful "nuclear warhead explosion" test to counter what it called US hostility, North Korean state TV reported, angering neighbours and the United States.

An earthquake with a magnitude of 5.3 was detected in the country's north on Friday morning, South Korea's meteorological agency said, in what officials said was the biggest ever such blast.

A state TV presenter said: "Scientists [from] ... the DPRK carried out a nuclear explosion test for the judgment of the power of a nuclear warhead newly studied and manufactured by them at the northern nuclear test ground."

The Democratic People's Republic of Korea is the North's official name.

"The Central Committee of the [ruling] Workers' Party of Korea sent warm congratulations to nuclear scientists ... of the northern nuclear test ground on the successful nuclear warhead explosion test," the presenter said.

The test would also enable the North to produce "as many as it wants [of] a variety of smaller, lighter and diversified nuclear warheads of higher strike power", she said.

The UN nuclear watchdog said the test was in "clear violation of numerous United Nations Security Council resolutions" and disregarded repeated demands from the international community.

"It is a deeply troubling and regrettable act," International Atomic Energy Agency (IAEA) Director General Yukiya Amano said in a video on the IAEA's website. He added that the IAEA is ready to resume verification activities in North Korea once a political agreement had been reached among the countries concerned.

NATO Secretary General Jens Stoltenberg "strongly condemned" the "very disturbing" development, telling Pyongyang it must drop all nuclear and ballistic missile activities.

"I strongly condemn these consistent provocations and violations of binding UN Security Council resolutions which undermine regional and international security," he said in a statement.

The tremor, detected by the US Geological Survey and Japan's Meteorological Agency's earthquake and tsunami observations division, happened near a known nuclear test site.

In January, North Korea detonated its fourth nuclear device at the same site.

READ MORE: World leaders unite to condemn nuclear test

The USGS said the explosion was detected at 9:30am local time at the surface. Its epicentre was 18km northeast of Sungjibaegam, the USGS said.

Tariq Rauf, head of the Stockholm International Peace Research Institute's disarmament programme, told Al Jazeera: "North Korea is the only country carrying out nuclear tests in the 21st century. That in and of itself is a problem issue.

"On the other hand, there are also provocations from North Korea's point of view. US and South Korean military exercises are becoming larger and more aggressive."

'Fanatic recklessness'

South Korean President Park Geun-hye called the test an act of "fanatic recklessness" in clear violation of UN Security Council resolutions.

US President Barack Obama and Park spoke by telephone about the event, South Korea's presidential office said. The 15-minute conversation took place as the US leader was on Air Force One returning to the US from a regional summit in Laos, according to the South Korean presidential office.

Obama said any provocative actions by North Korea would have "serious consequences", reiterating a US commitment to the security of its allies in Asia and around the world.

Japan's chief government spokesman said that Tokyo would consider further unilateral sanctions against North Korea.

READ MORE: North Korea says US sanctions are 'an act of war'

"North Korea's nuclear development is a grave threat to Japan's safety," Chief Cabinet Secretary Yoshihide Suga told a news conference.

China "firmly opposes" the test, the foreign ministry of Pyongyang's main diplomatic ally said.

"Today, the DPRK again conducted a nuclear test despite widespread international opposition - the Chinese government firmly opposes this," the ministry in Beijing said in a statement on its website, using the North's official name.

Al Jazeera's Adrian Brown, reporting from Beijing, said: "[The test is] a reminder of Beijing's impotence to try and bring North Korea to heel. Nothing China has so far said has had any effect on the North."

There was no indication that North Korea's nuclear test resulted in higher radiation levels in Russia's Far East, Russian news agencies cited Anna Popova, the head of Russia's consumer safety watchdog Rospotrebnadzor, as saying on Friday.

Russia's foreign ministry warned all sides against any escalation. Germany said it would likely summon the North Korean ambassador to Berlin.

Analysis from Al Jazeera's Harry Fawcett, reporting from Seoul.

"In the wake of this test, there have been very strong words from South Korea but those kinds of strong words from the South or the UN Security Council or anyone else have so far done nothing to slow down what has been going on under the leadership of Kim Jong-un.

Here in Seoul, we've heard from defence sources who say this was likely to have been a 10 kiloton-test.

But two tests in the same year tells us this is an accelerated programme under the leadership of Kim Jong-un. He has written into the constitution of the country this dual-pronged economic development and the pursuit of a viable nuclear deterrent - that is clearly what he wants to do.

There has been a great deal of long-range rocket and missile testing - just this year we have seen the Musudan missile tested for the first time. At the end of August, we saw a submarine-launched ballistic missile.

Kim is getting to the point where he has what he wants, which is a diversified means of carrying a nuclear warhead.

That would be a major deterrent, in the North Korean leadership's view, of any kind of forced regime change upon them. Obviously, the North Koreans think this is critical to the survival of the regime, and they have upped the stakes and increased the pace of their nuclear development."