MANILA — North Korea launched a missile early Friday — apparently to mark the 104th birthday of its founding leader, Kim Il-sung, the grandfather of the current leader, Kim Jong-un. But the test was a failure, according to American and South Korean defense officials.

The Pentagon confirmed, somewhat indirectly, that the test involved a ballistic missile when it called the launch a violation of United Nations Security Council resolutions that explicitly prohibit North Korea from using or testing ballistic missile technology.

The Defense Department said that its surveillance and radar systems “detected and tracked” the launch. It added that “the missile launched from North Korea did not pose a threat to North America.”

The test occurred while Defense Secretary Ashton B. Carter was in the Philippines as part of a tour of Asia.