The launch was North Korea’s 13th ballistic missile launch this year, said Roh Jae-cheon, spokesman of Seoul’s JCS.

North Korea fired a ballistic missile from its capital Pyongyang that flew over Japan before plunging into the northern Pacific Ocean, officials said on Tuesday, an aggressive test-flight over the territory of a close U.S. ally that sends a clear message of defiance as Washington and Seoul conduct war games nearby.

Seoul’s Joint Chiefs of Staff said the missile traveled around 2,700 km (1,677 miles) and reached a maximum height of 550 km (341 miles) as it flew over the northern Japanese island of Hokkaido. The launch, which appears to be the first to cross over Japan since 2009, will rattle a region worried that each new missile test puts the North a step closer toward its goal of an arsenal of nuclear missiles that can reliably target the United States. It appeared to be the North’s longest-ever missile test, but South Korean officials couldn’t immediately confirm.

North Korean missile launches have been happening at an unusually fast pace this year, and some analysts believe the North could have viable long-range nuclear missiles before the end of President Donald Trump’s first term in early 2021.

The South Korean military said it is analyzing the launch with the United States and has strengthened its monitoring and preparation in case of further actions from North Korea. Analysts speculate the North may have tested a new intermediate-range missile that Pyongyang recently threatened to fire toward the U.S. territory of Guam, which hosts a major military base. This missile landed nowhere near Guam, which is about 2,500 km (1,550 miles) south of Tokyo, but the length of Tuesday’s launch may have been designed for the North to show it could follow through on its threat. Seoul says the missile was launched from Sunan, which is where Pyongyang’s international airport is, opening the possibility that North Korea launched a road-mobile missile from an airport runway.

The launch was North Korea’s 13th ballistic missile launch this year, said Roh Jae-cheon, spokesman of Seoul’s JCS.

North Korea will no doubt be watching the world’s reaction to see if it can use Tuesday’s flight over Japan as a precedent for future launches. Japanese officials said there was no damage to ships or anything else reported. Japan’s NHK TV said the missile separated into three parts. “We will do our utmost to protect people’s lives,” Prime Minister Shinzo Abe told reporters. “This reckless act of launching a missile that flies over our country is an unprecedented, serious and important threat.”

Tuesday’s launch comes days after the North fired what was assessed as three short-range ballistic missiles into the sea and a month after its second flight test of an intercontinental ballistic missile, which analysts say could reach deep into the U.S. mainland when perfected.

South Korea’s Foreign Ministry warned that the North will face a “strong response” from the U.S.-South Korean alliance if what it called nuclear and missile provocations continue. The ministry also urged Pyongyang to accept talks over its nuclear program and acknowledge that abandoning its nuclear ambitions is the only way to guarantee its security and economic development.

South Korea also said its air force also conducted a live-fire drill involving four F-15 fighters dropping eight MK-84 bombs that accurately hit targets at a military field near the country’s eastern coast. Park Su-hyun, spokesman of South Korean President Moon Jae-in, said Mr. Moon’s national security director Chung Eui-yong called President Donald Trump’s national security adviser H.R. McMaster to discuss the launch.

The launch over Japan isn’t a total surprise. Earlier this month, when threatening to lob four Hwasong-12s, which are new intermediate-range missiles, into the waters near Guam, North Korea specifically said they would fly over Japanese territory. North Korea in June also angrily reacted to the launch of a Japanese satellite it said was aimed at spying on the North and said Tokyo was no longer entitled to fault Pyongyang “no matter what it launches or whether that crosses the sky above Japan.”

North Korea typically reacts with anger to U.S.-South Korean military drills, which are happening now, often testing weapons and threatening Seoul and Washington in its state-controlled media. But animosity is higher than usual following threats by Mr. Trump to unleash “fire and fury” on the North, and Pyongyang’s stated plan to consider firing some of its missiles near Guam.

Kim Dong-yub, a former South Korean military official who is now an analyst at Seoul’s Institute for Far Eastern Studies, said the early flight data suggests the North Korean missile was likely a Hwasong-12. Other possibilities, he said, include a midrange Musudan, a missile with a potential 3,500-km (2,180—mile) range that puts much of the Asia—Pacific region within reach, or a Pukguksong-2, a solid-fuel missile that can be fired faster and more secretly than weapons using liquid fuel.

South Korea’s military didn’t immediately confirm whether the North Korean missile was fired from Pyongyang’s airport. Moon Seong Mook, a former South Korean military official and current analyst for the Seoul-based Korea Research Institute for National Strategy, said the airport’s runways could provide the ideal space to launch a road—mobile missile like the Hwasong—12. By launching from its capital, the North might have been trying to demonstrate the ability to launch its missiles from anywhere, Mr. Moon said.

“The launch doubled as a threat to Washington, not only because of the U.S. military bases in Japan, but also that the North showed it has the real capability to fire missiles to waters near Guam if it chose to shoot them in that direction,” Moon said.

North Korea first fired a rocket over Japanese territory in August of 1998 when a multistage rocket that outside experts called “Taepodong-1” flew about 1,500 km (932 miles) before landing in the Pacific Ocean. The North later said it launched a satellite.

North Korea flew another rocket over Japan again in April 2009 and said that, too, was carrying a satellite. The North claimed success, but the U.S. North American Aerospace Defense Command says no satellite reached orbit. The United Nations has repeatedly condemned North Korean satellite launches as covers meant to test banned long-range missile technology. Some parts of a space launch vehicle reportedly flew over Okinawa last year after separating from the rocket.

Pyongyang regularly claims the U.S.-South Korean military exercises are an invasion rehearsal, although analysts say the North’s anger is partly because the impoverished country must react with its own expensive drills and weapons tests. The allies say the war games are defensive and meant to counter North Korean aggression.

North Korea’s U.N. ambassador, Ja Song Nam, wrote recently that the exercises are “provocative and aggressive” at a time when the Korean Peninsula is “like a time bomb.”