SEOUL, SOUTH KOREA — North Korea conducted its longest-ever test flight of a ballistic missile Friday, sending an intermediate-range weapon hurtling over U.S. ally Japan into the northern Pacific Ocean in a launch that signals both defiance to its rivals and a big technological advance.



Since President Donald Trump threatened the North with "fire and fury" in August, Pyongyang has conducted its most powerful nuclear test, threatened to send missiles into the waters around the U.S. Pacific island territory of Guam and launched two missiles of increasing range over Japan. July saw its first tests of intercontinental ballistic missiles that could strike deep into the U.S. mainland when perfected.



The growing frequency, power and confidence displayed by these tests seem to confirm what governments and outside experts have long feared: North Korea is closer than ever to its goal of building a military arsenal that can viably target both U.S. troops in Asia and the U.S. homeland. This, in turn, is meant to allow North Korea greater military freedom in the region by raising doubts in Seoul and Tokyo that Washington would risk the annihilation of a U.S. city to protect its Asian allies.



South Korea's Joint Chiefs of Staff said the latest missile traveled about 2,300 miles and reached a maximum height of 478 miles. Guam, which is the home of important U.S. military assets, is 2,112 miles away from North Korea.



North Korea's weapons tests demonstrate that it can "turn the American empire into a sea in flames through sudden surprise attack from any region and area," Pyongyang's Rodong Sinmun newspaper said Friday, without mentioning the latest missile test.



South Korean President Moon Jae-in, a liberal who initially pushed for talks with North Korea, said that Pyongyang's tests currently made dialogue "impossible."



"The sanctions and pressure by the international community will only tighten so that North Korea has no choice but to take the path for genuine dialogue" for nuclear disarmament, Moon said. "If North Korea provokes us or our allies, we have the strength to smash the attempt at an early stage and inflict a level of damage it would be impossible to recover from."



North Korea has repeatedly vowed to continue its weapons tests amid what it calls U.S. hostility — by which it means the presence of nearly 80,000 U.S. troops stationed in Japan and South Korea. Robust international diplomacy on the issue has been stalled for years, and there's so far little sign that senior officials from Pyongyang and Washington might sit down to discuss ways to slow the North's determined march toward inclusion among the world's nuclear weapons powers.



Friday's test, which Seoul said was the 19th launch of a ballistic missile by North Korea this year, triggered sirens and warning messages in northern Japan but caused no apparent damage to aircraft or ships. It was the second missile fired over Japan in less than a month. North Korea conducted its sixth and most powerful nuclear test on Sept. 3.



The missile was launched from Sunan, the location of Pyongyang's international airport and the origin of the earlier missile that flew over Japan. Analysts have speculated the new test was of the same intermediate-range missile launched in that earlier flight, the Hwasong-12, and was meant to show Washington that the North can hit Guam if it chose to do so.



Despite its impressive range, the North's missile probably still isn't accurate enough to destroy Guam's Andersen Air Force Base, said David Wright, a U.S. missile expert with the Union of Concerned Scientists. Such early generation missiles are often inaccurate because of guidance and control errors during the boost and re-entry phases as the warhead passes through the atmosphere late in flight, Wright said.



South Korea detected North Korean launch preparations Thursday, and President Moon ordered a live-fire ballistic missile drill if the launch happened. This allowed Seoul to fire its missiles only six minutes after the North's launch Friday. One of the two missiles hit a sea target about 155 miles away, which was approximately the distance to Pyongyang's Sunan, but the other failed in flight shortly after launch, South Korea's Joint Chiefs of Staff said.



The U.N. Security Council scheduled an emergency closed-door meeting to be held Friday afternoon in New York. Trump didn't immediately comment.



North Korea initially flight-tested the Hwasong-12 and the ICBM model Hwasong-14 at highly lofted angles to reduce their range and avoid neighboring countries.



The two launches over Japan indicate North Korea is moving toward using angles close to operational to determine whether its warheads can survive the harsh conditions of atmospheric re-entry and detonate properly.



North Korea's August launch over Japan came weeks after it threatened to fire a salvo of Hwasong-12s toward Guam and bracket the island with "enveloping" missile fire.



North Korea has been accelerating its nuclear weapons development under leader Kim Jong Un, a third-generation dictator who has conducted four of North Korea's six nuclear tests since taking power in 2011. The weapons being tested include hard-to-detect solid-fuel missiles designed to be launched from road mobile launchers or submarines.



The U.N. Security Council unanimously approved new sanctions earlier this week over the nuclear test, which Pyongyang claimed was a detonation of a thermonuclear weapon built for its ICBMs. The sanctions ban all textile exports and prohibit any country from authorizing new work permits for North Korean workers — two key sources of hard currency. They also prohibit North Korea from importing all natural gas liquids and condensates, and cap Pyongyang's imports of crude oil and refined petroleum products.



North Korea's Foreign Ministry denounced the U.N. sanctions and said the North will "redouble its efforts to increase its strength to safeguard the country's sovereignty and right to existence."



Mari Yamaguchi in Tokyo contributed to this report