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.