The underground explosion could take North Korea a big step closer to its goal of building a nuclear warhead small enough to be mounted on a long-range missile that could threaten the United States.
Official state media said the test was conducted in a safe manner and is aimed at coping with "outrageous" U.S. hostility that "violently" undermines the North's peaceful, sovereign rights to launch satellites. North Korea faced sanctions after a December launch of a rocket the U.N. and Washington called a cover for a banned missile test.
The North said it used a "lighter, miniaturized atomic bomb" that still has more explosive force than past tests.
The United States Geological Survey said earlier Tuesday that it had detected a 4.9 magnitude earthquake in North Korea.
The nuclear test is North Korea's first since leader Kim Jong Un took power in December 2011 following the death of his father, Kim Jong Il, and marks a bold statement for the young leader as he unveils his domestic and foreign policy for a country long estranged from the West.
South Korea's U.N. Mission informed reporters early Tuesday that he U.N. Security Council will hold an emergency meeting on North Korea's nuclear test on Tuesday morning. South Korea joined the Security Council in January for a 2-year term and currently holds the council's rotating presidency.
South Korea's Foreign Minister Kim Sung-hwan is in New York to preside over a council meeting scheduled to begin at 10 a.m. (1500 GMT) on the protection of civilians in armed conflicts.
Experts say regular tests are needed to perfect North Korea's goal of building nuclear warheads small enough to be placed on long-range missiles. This atomic test - North Korea's third since 2006 - is expected to take Pyongyang closer to possessing nuclear-tipped missiles designed to strike the United States.