SEOUL – South Korea has test-fired a new ballistic missile with a range of 500 kilometers (310 miles) and will try to extend the range to 800 kilometers so it can strike any site in North Korea, Seoul said Friday, days after Pyongyang fired a midrange missile.

The missiles are intended to counter the threat from North Korea’s missile and nuclear programs, Defense Ministry spokesman Kim Min-seok said. The move is likely to rattle the North, which has been hit with U.N. sanctions over its missile tests.

Under an agreement with the United States, South Korea adopted a voluntary ban on developing ballistic missiles with a range of more than 300 kilometers, but the allies agreed in 2012 to allow the South to develop 800-kilometer missiles.

“We test-fired it, and we succeeded,” Kim told a briefing when asked if the military had recently conducted a 500-kilometer missile test. “And we’re going to make 800-kilometer missiles.”

The new missiles will be used to strike the North’s weapons and military installations in the farthest part of the country from anywhere in the South if needed, he added.

The two Koreas are technically still at war, since the 1950-53 Korean War ended in a truce, rather than an armistice.

North Korea last week fired a midrange ballistic Rodong missile that fell into the sea off its east coast after flying about 650 kilometers. The Rodong’s maximum range is thought to be about 1,300 kilometers — enough to hit much of Japan.

North Korea this week fired more than 500 rounds of artillery into the sea off its west coast near a disputed maritime border in the latest saber-rattling under its young leader, Kim Jong Un, who has vowed to build nuclear weapons. More than 100 rounds landed in the waters of the South, prompting it to fire back more than 300 rounds into the North’s waters.

South Korea is also investigating two drones that crashed near the border, which it believes were flown by Pyongyang. One was recovered with evidence of having flown directly over the South’s presidential palace.

North Korea’s state media said last year that leader Kim Jong Un had supervised a drill of “superprecision” drone attacks on a simulated South Korean target.

Although the North has one of the world’s largest standing armies, much of its equipment consists of antiquated Soviet-era designs. It has focused resources on developing nuclear and long-range missile programs.