SEOUL — North Korea on Wednesday launched a space vehicle carrying its first military reconnaissance satellite designed to monitor the South Korean and American militaries, South Korean defense officials said, briefly triggering “false alarm” evacuation alerts in South Korea and Japan.

The South Korean military indicated hours later that the North Korean launch had been a failure, saying that the rocket fell in waters west of South Korea after an “abnormal flight.” North Korea admitted that the second stage of its new Chollima-1 rocket had malfunctioned, sending it tumbling down to the sea west of the Korean Peninsula. It said it would attempt another launch in the near future after identifying and fixing problems with the rocket and its fuel.

As the rocket roared to the south, an automatic emergency text message told citizens in Seoul to “prepare to evacuate” for fear that debris from the North Korean rocket might fall on the South Korean capital. The government later retracted the alert.

For many residents in Seoul, the launch of the rocket, which North Korea had announced days earlier, caused less alarm than the panic that came after the false alert was issued by the South Korean government, sowing confusion and fear around the city.

In Japan, the government sent alerts in Okinawa Prefecture urging residents to seek shelter inside and away from windows, but just after 7 a.m. the alert was lifted as the government announced the missile was not flying toward Japan. Less than 10 minutes later, the Ministry of Defense announced a projectile had already fallen into the water.

The launch on Wednesday signaled a space race heating up in the sky over the Korean Peninsula. The United States, Russia, China and Japan already have satellites watching the peninsula, one of the flash points of East Asia. South Korea recently joined the fray by vowing to ​place its first military spy satellite ​in orbit ​by 2025 and testing a launch rocket twice since March last year.

When Kim Jong-un, North Korea’s leader, ordered his country to double down on its efforts to ​enlarge and diversify its ​nuclear ​arsenal​ during​ a ruling Workers’ Party meeting in 2021, he made it one of his priorities to place military spy satellites into orbit.​

Spy satellites would make the North’s nuclear arsenal more dangerous by giving its military eyes in the sky​, military experts say​. They ​would also help North Korea collect data from its missile tests as the country struggles to perfect its intercontinental ballistic missile technologies.

But experts have also question​ed​ the capabilities of the North’s prototype satellite, which the North has said would be carried by the rocket launched on Wednesday​.

​The rocket lifted off from a launchpad in Tongchang-ri in the northwestern corner of North Korea.​ The rocket was programmed to fly over the sea between China and the Korean Peninsula and over the waters east of the Philippines. As the countdown began, South Korea and Japan ​placed their militaries on extra vigilance in case debris fell on their territories.

They both had urged Pyongyang to cancel its satellite launch, condemning it as a dangerous provocation.

Washington strongly condemned the Wednesday launch, calling it a brazen violation of U.N. Security Council resolutions. Adam Hodge, a spokesman for the National Security Council at the White House, said in a statement that it risked “destabilizing the security situation in the region and beyond.”

​​Under a series of resolutions from the United Nations Security Council, North Korea is banned from launching space rockets, as well as testing nuclear weapons and ballistic missiles that could be used to deliver them. North Korea insists on its right to a peaceful space program, but Washington and its allies have long accused it of using such a program as a cover for testing ​intercontinental ​ballistic missile technologies.

​In recent months, Washington and its allies have expanded their joint military drills to help guard against North Korea’s growing nuclear and missile threats. They plan to conduct a Proliferation Security Initiative exercise on Wednesday, when their navies will practice interdicting vessels carrying materials for weapons of mass destruction to and from countries like North Korea. Last week, the American and South Korean militaries also started the first of a series of live-fire drills planned until mid-June near the border with North Korea.

The “dangerous military acts by the U.S. and its vassal forces” compel North Korea to secure “a reliable reconnaissance and information means,” Ri Pyong Chol, vice chairman of the North’s Central Military Commission, said on Monday, revealing the plan to launch the North’s “military reconnaissance satellite No. 1.”

North Korea’s space and ​ICBM programs are closely interlocked.

In 2012, months after Mr. Kim took power, North Korea launched a rocket that it said carried a satellite. In a major embarrassment to ​the young leader, the rocket disintegrated moments after launching. But eight months later, another North Korean rocket flew as far as the Philippines. North Korea last claimed to have launched a satellite in 2016, when its rocket also flew over the sea near the Philippines.

None of these rockets were believed to be carrying a sophisticated satellite. But their launches showed that the North was making progress in building a rocket powerful enough to carry a satellite into orbit or a warhead on an intercontinental range.

The country conducted its first ICBM test in 2017.

​North Korea stepped up its space and ICBM programs after Mr. Kim’s diplomacy with President Donald J. Trump collapsed in 2019.

When it tested​ rockets off its east coast in Fe​bruary and March ​​last year, it claimed to have done so to prepare to launch a satellite. But South Korea​ accused the North of testing a rocket for its new Hwasong-17 ICBM. In November, the North conducted its first successful test of the Hwasong-17.

​In December, the country conducted a ground test of​​ a ​​new ​solid-fuel booster rocket​, a major upgrade in the North’s ICBM program because solid-fuel missiles are faster to launch and harder to intercept. In the same month, North Korea launched rockets that the South called missile tests but the North said were tests of satellite-launching technologies.

In April, ​North Korea conducted the first flight test of the Hwasong-18, ​ its first solid-fuel ICBM.

Choe Sang-Hun reported from Seoul, and Motoko Rich from Tokyo.