South Korea says it has carried out its first underwater-launched missile test, hours after rival North Korea fired two ballistic missiles toward the sea.

President Moon Jae-in’s office said in a statement that Moon observed the test of a domestically built submarine-launched ballistic missile on Wednesday afternoon.

It says the missile fired from a 3,000-ton-class submarine flew a previously set distance before hitting a designated target.

The announcement followed two North Korean ballistic missile launches detected by South Korea earlier Wednesday.

Also read: All about new long-range cruise missiles North Korea says it tested this week

North Korea fired two ballistic missiles toward the sea in defiance of U.N. resolutions, the second weapons test in several days that experts say shows it’s pressing ahead with its arms build-up plans while nuclear diplomacy with the United States remains stalled.

South Korea's Joint Chiefs of Staff said that the missiles, launched from central North Korea, flew about 800 kilometers (497 miles) on an apogee of 60 kilometers (37 miles) before landing in the waters between the Korean Peninsula and Japan. The military said South Korean and U.S. intelligence authorities are analyzing more details about the launches.

The U.S. Indo-Pacific Command said the launches, while highlighting the destabilizing impact of North Korea's illicit weapons program, didn't pose an immediate threat to “U.S. personal or territory, or to our allies."

Also read: North Korea's Kim Jong Un's weight loss takes limelight in military parade

“The firings threaten the peace and safety of Japan and the region and are absolutely outrageous,” Japanese Prime Minister Yoshihide Suga said. “The government of Japan is determined to further step up our vigilance and surveillance to be prepared for any contingencies.”

Japan’s coast guard said no ships or aircraft reported damage from the missiles.

The launches were a violation of U.N. Security Council resolutions that bar North Korea from engaging in any ballistic missile activities. But the U.N. council typically doesn't slap fresh sanctions on North Korea when it launches short-range missiles, like the ones fired Wednesday.

The latest launches came two days after North Korea said it tested a newly developed cruise missile twice over the weekend. North Korea’s state media described the missile as a “strategic weapon of great significance,” implying it was developed with the intent to carry nuclear warheads. According to North Korean accounts, the missile demonstrated an ability to hit targets 1,500 kilometers (930 miles) away, a distance putting all of Japan and U.S. military installations there within reach.

Also read: North Korea suspended from 2022 Beijing Winter Olympics: IOC

Many experts say the recent tests suggested North Korea is pushing to bolster its weapons arsenal while applying pressure on President Joe Biden's administration amid a deadlock in nuclear diplomacy between Pyongyang and Washington.

“North Korea is implementing a schedule of missile development that was planned before Biden came to office. That schedule can be adjusted for political reasons but is primarily driven by security strategy and technical factors,” said Leif-Eric Easley, a professor of international studies at Ewha University in Seoul.

Wednesday’s launches came as Chinese Foreign Minister Wang Yi was in Seoul for meetings with South Korean President Moon Jae-in and other senior officials to discuss the stalled nuclear negotiations with the North.

It’s unusual for North Korea to make provocative launches when China, its last major ally and biggest aid provider, is engaged in a major diplomatic event.

Also read: Alaska lawmaker sorry for praising Nazi experiments in pro-vaccine argument

Moon’s office said Moon told Wang that he appreciates China’s role in the international diplomatic push to resolve the North Korean nuclear standoff and asked for Beijing’s continuing support. Wang said Beijing will continue to support the denuclearization of the Korean Peninsula and improved ties between the Koreas.

Moon’s office said the government plans to hold an unscheduled national security council meeting later Wednesday.

The talks between the United States and North Korea have stalled since 2019, when the Americans rejected the North’s demand for major sanctions relief in exchange for dismantling an aging nuclear facility. Kim’s government has so far threatened to build high-tech weapons targeting the United States and rejected the Biden administration’s overtures for dialogue, demanding that Washington abandon its “hostile” policies first.

North Korea ended a yearlong pause in ballistic tests in March by firing two short-range ballistic missiles into the sea, continuing a tradition of testing new U.S. administrations with weapons demonstrations aimed at measuring Washington’s response and wresting concessions.

North Korea still maintains a self-imposed moratorium on nuclear and long-range missile tests, a sign that it may not want to completely scuttle the nuclear negotiations with the United States.