The U.S. military on Sunday conducted a test of its THAAD anti-ballistic missile system, two days after North Korea launched its second intercontinental ballistic missile.

This test was expected after a warning from the U.S. Coast Guard last week. Earlier this month, the U.S. Missile Defense Agency said it would be conducting two THAAD tests this month from Kodiak, Alaska. This is the second of the two tests.

The test comes as Gen. Terrence J. O’Shaughnessy, U.S. Pacific Air Forces commander, warned North Korea that U.S. and its allies are prepared to use "rapid, lethal and overwhelming force," if necessary against the rogue nation.

"The U.S. Missile Defense Agency and U.S. Army soldiers of the 11th Air Defense Artillery Brigade from Fort Bliss, Texas, conducted a successful missile defense test today using the Terminal High Altitude Area Defense (THAAD) system," the Missile Defense Agency said in a statement on Sunday.

The medium-range target ballistic missile (MRBM) was launched over the Pacific Ocean and the THAAD weapon system tracked and intercepted it in Kodiak.

"In addition to successfully intercepting the target, the data collected will allow MDA to enhance the THAAD weapon system, our modeling and simulation capabilities, and our ability to stay ahead of the evolving threat," MDA Director Lt. Gen. Sam Greaves said.

THAAD is used to intercept short- and intermediate-range ballistic missiles. It does not target intercontinental ballistic missiles. The U.S. has a perfect record of launches, hitting 15 out of 15 targets, the Pentagon said.

The latest launch comes in the wake of North Korea's latest ICBM test. Analysts said flight data from the North's second ICBM test, conducted Friday night, showed that a broader part of the mainland United States, including Los Angeles and Chicago, is now in range of Pyongyang's weapons.

"North Korea remains the most urgent threat to regional stability," O'Shaughnessy said.

"Diplomacy remains the lead. However, we have a responsibility to our allies and our nation to showcase our unwavering commitment while planning for the worst-case scenario," O'Shaughnessy added.

Fox News' Lucas Tomlinson and The Associated Press contributed to this report.