SEOUL, South Korea — North Korea on Tuesday claimed it successfully test-launched its first intercontinental ballistic missile, a potential game-changing development in what may be the world’s most dangerous nuclear standoff and, if true, a direct rebuke to US President Donald Trump’s earlier declaration that such a test “won’t happen!”

In typically heated rhetoric, North Korea’s Academy of Defense Science said the test of an ICBM — the Hwasong-14 — marked the “final step” in creating a “confident and powerful nuclear state that can strike anywhere on Earth.”

Unless outsiders retrieve parts of the missile, it will be difficult to confirm many details. North Korea’s weapons program is perhaps the most closely held state secret in one of the world’s most suspicious nations. US, South Korean and Japanese officials earlier assessed that the North fired an intermediate-range missile into waters near Japan.

Japanese Chief Cabinet Secretary Yoshihide Suga declined to comment on whether Japan thinks it was an ICBM, and South Korea’s Defense Ministry said it was analyzing whether the North’s statement was accurate.

The launch appeared to be North Korea’s most successful missile test yet. A US scientist examining the height and distance said the missile could potentially be powerful enough to reach Alaska.

North Korea has previously launched satellites in what critics said were disguised tests of its long-range missile technology. A test-launch of an ICBM, however, would be a major step in developing nuclear-armed missiles that could reach anywhere in the United States.

The launch sends a political warning to Washington and its chief Asian allies, Seoul and Tokyo, while also allowing North Korean scientists a chance to perfect their still-incomplete nuclear missile program. It came on the eve of the US Independence Day holiday, days after the first face-to-face meeting of the leaders of South Korea and the United States, and ahead of a global summit of the world’s richest economies.

Outside and North Korean analyses of the missile’s height, distance and time in the air were roughly similar.

US, South Korean and Japanese officials say it flew for about 40 minutes and reached an altitude of 2,500 kilometers (1,500 miles), which would be longer and higher than any similar North Korean test previously reported. It also covered a distance of about 930 kilometers (578 miles).

North Korea said the missile flew as high as 2,802 kilometers (1,741 miles) before hitting a designated target in the ocean about 933 kilometers (580 miles) away from the launch site in the North’s northwest. It said the missile flew for about 39 minutes and was made at the highest possible angle.

Before North Korea’s announcement of an ICBM, South Korean analysts said it was likely that it was a retest of one of two intermediate-range missiles launched earlier this year.

One US missile scientist, David Wright, estimated that the highly lofted missile, if the reported time and distance are correct, could have a possible maximum range of 6,700 kilometers (4,163 miles), which could put Alaska in its range, if fired at a normal trajectory.

North Korea has a reliable arsenal of shorter-range missiles and is thought to have a small arsenal of atomic bombs, but is still trying to perfect its longer-range missiles. Some outside civilian experts believe the North has the technology to mount warheads on shorter-range Rodong and Scud missiles that can strike South Korea and Japan, two key US allies where about 80,000 American troops are stationed. But it’s unclear if it has mastered the technology needed to build an atomic bomb that can fit on a long-range missile.

Soon after the morning launch, President Trump responded on Twitter: “North Korea has just launched another missile. Does this guy have anything better to do with his life? Hard to believe that South Korea and Japan will put up with this much longer. Perhaps China will put a heavy move on North Korea and end this nonsense once and for all!”

“This guy” presumably refers to North Korean leader Kim Jong Un. China is North Korea’s economic lifeline and only major ally, and the Trump administration is pushing Beijing to do more to push the North toward disarmament.

After North Korea claimed earlier this year it was close to an ICBM test launch, Trump took to Twitter and said: “It won’t happen!”

The missile test could invite a new round of international sanctions, but North Korea is already one of the most sanctioned countries on Earth. UN Security Council resolutions ban it from engaging in any ballistic activities. Since late 2012, North Korea has placed two satellites into orbit with long-range rockets, each time triggering new UN sanctions and worldwide condemnation.

Last year, North Korea conducted its fourth and fifth atomic bomb tests and claimed a series of technical breakthroughs in its efforts to develop long-range nuclear missiles. The fifth nuclear test in September was the North’s most powerful atomic detonation to date.

In their meeting last week, South Korean President Moon Jae-in and Trump vowed to oppose North Korea’s development of atomic weapons.

Japanese Prime Minister Shinzo Abe sharply criticized North Korea for the launch. “The latest launch clearly showed that the threat is growing,” Abe said.

Abe, who talked by phone with Trump on Monday, said the two leaders plan to seek cooperation from world leaders when they attend a G-20 summit in Germany.

On May 14, North Korea launched a Hwasong-12 missile that its state media said flew as high as 2,111 kilometers (1,310 miles) and landed in a targeted area in the ocean about 787 kilometers (490 miles) from the launch site. On May 21, North Korea tested a Pukguksong-2, which traveled about 500 kilometers (310 miles).

The Korean Peninsula has been divided since before the 1950-53 Korean War. Almost 30,000 US troops are stationed in South Korea.

Since taking office on May 10, Moon has tried to improve strained ties with North Korea, but the North has continued its missile tests. North Korea says it needs nuclear weapons and powerful missiles to cope with what it calls rising US military threats.

Since taking office after his dictator father Kim Jong Il’s death in late 2011, Kim Jong Un has overseen three nuclear weapons tests and a slew of missile tests. Regional disarmament talks on North Korea’s nuclear program have been deadlocked since 2009, when the North pulled out of the negotiations to protest international condemnation over a long-range rocket launch.