WASHINGTON - President Barack Obama said on Monday that nuclear and missile tests conducted by North Korea were a grave concern to all nations and a legal violation that warranted action by the international community.

North Korea's attempts to develop nuclear weapons, as well as its ballistic missile program, constitute a threat to international peace and security, Obama said in a statement after Pyongyang conducted a nuclear test and reportedly fired a short-range missile.

The nuclear test was a major diplomatic challenge to Obama at a time when he is facing a global economic crisis and working to curb Iran's nuclear enrichment program, which the West fears is aimed at producing nuclear arms but Tehran says is for energy.

Obama vowed when he took office to extend a hand to troublesome countries willing to unclench your fist but so far he has had little success with North Korea or Iran, which have continued to advance their nuclear programs and showed little interest in renewed dialogue.

The nuclear test was Pyongyang's second -- its first was in October 2006 -- and came just two months after North Korea launched a rocket believed to be a test of its long-range missile capability. Pyongyang said it had put a communications satellite into space.

North Korea's attempts to develop nuclear weapons, as well as its ballistic missile program, constitute a threat to international peace and security, Obama said in his statement.

'RECKLESSLY CHALLENGING'

Calling the nuclear test a violation of international law, Obama said, North Korea is directly and recklessly challenging the international community.

He said his administration would work through the U.N. Security Council and the six-party talks on North Korea to address the issue. Under the so-called six-party talks among the two Koreas, China, Japan, Russia and the United States, North Korea committed in 2005 to abandon all its nuclear programs.

Pyongyang has been engaged in years of on-off negotiations with regional powers, which have been pressing the impoverished state to give up its nuclear ambitions in return for massive aid and an end to the country's pariah status.

North Korea had been threatening for some time that it would conduct another nuclear test. Stephen Bosworth, the U.S. special envoy for North Korea, warned earlier this month that Pyongyang would face consequences if it carried out a test but said there was little Washington could do to stop it.

Admiral Mike Mullen, chairman of the Joint Chiefs of Staff, said on CBS's The Early Show that the test indicated North Korea's growing belligerence, isolation and defiance of international law.

All of those things point to a country that I think continues to destabilize that region and actually in the long term should they continue to develop a nuclear weapons program, pose a significant threat to the United States, he said.

North Korea said it successfully conducted the nuclear test on Monday and ratcheted up tensions a few hours later by firing what the Yonhap news agency said was a short-range missile.

Mullen told CNN it would take a couple of days to verify the test but said there was no indication that it wasn't as they say.

The (U.S.) Geological Survey confirmed that a seismic event took place consistent with a test, the official said on condition of anonymity.

We are consulting with our six-party and U.N. Security Council partners on next steps, A U.S. State Department official said.

U.S. observers speculated that North Korea's actions were part of an attempt to deter any external interference as it prepares for internal succession. Scott Snyder of the Asia Foundation in Washington said it suggested Pyongyang had a heightened sense of vulnerability at the moment.

One has to wonder if this is part of the internal political transition that may be occurring inside North Korea, said Jim Walsh, an expert in international security and a research associate at the Massachusetts Institute of Technology.