SEOUL, South Korea — North Korea launched a missile on Saturday, even as the United States and China have been seeking to curb the North’s military ambitions. But the test ended in failure, the South Korean military said. It was the second consecutive failure in the past two weeks.

The missile took off from a location near Pukchang, northeast of Pyongyang, the North Korean capital, the South Korean military said in a statement. It did not identify what type of missile was launched.

Cmdr. Dave Benham, a spokesman for the United States Pacific Command, said the American military had “detected what we assess was a North Korean missile launch” from near the Pukchang airfield.

“The missile did not leave North Korean territory,” Commander Benham added. “The North American Aerospace Defense Command determined the missile launch from North Korea did not pose a threat to North America.”