South Korea says another intermediate-range ballistic missile test by North Korea has failed. The announcement comes just hours after Chinese President Xi Jinping said he would not allow security on the Korean peninsula to deteriorate. (Reuters)

North Korea test-fired another intermediate-range ballistic missile early Thursday, South Korean military officials said, but the launch appears to have failed, for a second time in two weeks.

The apparent failure would be embarrassing for Kim Jong Un’s regime ahead of next week’s much-anticipated Workers’ Party Congress — if it chose to report it. Instead, North Korea’s propaganda department has been busy whipping up excitement about the congress, the first in 36 years.

Some analysts — and the South Korean president, Park Geun-hye — say there is a reasonable chance that Kim could conduct a fifth nuclear test in the lead-up to the congress, which will open May 6 and could be a platform for Kim to announce policy and personnel changes.

South Korean military officials said Thursday that satellites detected the launch on North Korea’s east coast.

“The missile, presumed to be a Musudan, was fired around 6:40 a.m. from the vicinity of Wonsan, but it appears to have crashed a few seconds later,” the Yonhap News Agency quoted an official as saying.

North Korea attempted its first test of a Musudan — a missile also known as a BM-25 that is technically capable of reaching the U.S. territory of Guam — two weeks ago, on the 104th anniversary of the birthday of the country’s “eternal president,” Kim Il Sung, who died in 1994. That missile exploded a few seconds after takeoff.

Thursday’s launch was also “highly likely” a failure, officials said.

But analysts warn that even failed tests give North Korea’s rocket scientists opportunities to learn about weaknesses in their designs and iron out problems.

South Korea’s Foreign Ministry condemned the launch and said Seoul would push for further ways to punish Pyongyang.

Earlier in the day, Park said that “there will no longer be a future” for North Korea if it goes ahead with another nuclear test.

“It will be taking place under the strongest-ever U.N. Security Council sanctions imposed upon the fourth test. This is an explicit full-frontal challenge and provocation against the international society,” the president told her national security council.

North Korea has displayed the Musudan at its military parades and is believed to have supplied assembly kits for the missile to Iran, but until this month it had never tested the model.

North Korea is banned by U.N. Security Council resolutions from launching ballistic missiles or carrying out nuclear tests. But this year, ahead of the congress, it has been testing one piece of technology after another.

It conducted a test in January of what it said was a hydrogen bomb — but was likely to have been a simpler atomic one — then in February launched a long-range rocket that appeared to be part of an intercontinental ballistic missile program. Last weekend, North Korea claimed to have launched a ballistic missile from a submarine.

A senior Pentagon official said this month that North Korea’s weapons and missile programs pose a growing threat to the United States and its allies in East Asia.

North Korea is “seeking to develop longer-range ballistic missiles capable of delivering nuclear weapons to the United States and continues efforts to bring [a road-mobile intercontinental ballistic missile] to operational capacity,” Brian McKeon told a Senate Armed Services subcommittee.

North Korea has fired numerous short-range missiles and rockets into the Sea of Japan and has boasted of multiple advances in its missile technology.

One purported advance — its use of road-mobile launchers — appears to be true. South Korean officials have reported seeing, on satellite images, Musudan missiles on mobile launchers moving around the east coast.

This is concerning because the mobile launchers can be hidden in tunnels or buildings and rolled out when needed, allowing missiles to be prepared for firing much more quickly than from traditional launch pads and making the preparations much more difficult for satellites to spot.