A Terminal High Altitude Area Defense (THAAD) interceptor is launched during a successful intercept test, in this undated handout photo provided by the U.S. Department of Defense, Missile Defense Agency.

The U.S. has conducted a test of its Terminal High Altitude Area Defense (THAAD) defense system in Alaska by launching a ballistic missile over the Pacific Ocean, military officials said early Sunday.

The weapon was fired by a U.S. Air Force plane and intercepted by the system, the Missile Defense Agency (MDA) said, describing the test as "successful."

The exercise will help the U.S. "to stay ahead of the evolving threat," said MDA Director Lt. Gen. Sam Greaves in a statement, without elaborating.

Earlier this month, U.S. officials told Reuters that the military was planning a test amid tensions with North Korea. The U.S. has THAAD interceptors in Guam that are meant to help guard against a missile attack from a country such as North Korea.

More from NBC News:

US bombers fly over South Korea after North Korean ICBM test

Australian PM Says 4 Arrested in Raids to Disrupt Plot to Bring Down Plane

Trump says repeal and replace is not dead, unless GOP are 'quitters'

THAAD is a ground-based missile defense system designed to shoot down short-, medium- and intermediate-range ballistic missiles.

Lockheed Martin Corp, the prime contractor for the THAAD system, said it has the ability to intercept incoming missiles both inside and outside the Earth's atmosphere.

"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 MDA statement said.

"A medium-range target ballistic missile (MRBM) was air-launched by a U.S. Air Force C-17 over the Pacific Ocean. The THAAD weapon system located at Pacific Spaceport Complex Alaska in Kodiak, Alaska, detected, tracked and intercepted the target."

The U.S. has also deployed THAAD in South Korea to guard against North Korea's shorter-range missiles — angering China, which says the system's powerful radar can probe deep into its territory. Moscow and Beijing, in a joint statement, earlier this month called on Washington to immediately halt deployment of THAAD in South Korea.