The border between the two countries has long been considered to be one of the most dangerous flashpoints in the world.
Hundreds of thousands of troops and tens of thousands of artillery pieces have been locked in a decades-long standoff, separated by only four kilometres of neutral ground, known as the demilitarised zone.
South Korea’s military said warning shots had been fired at a North Korean merchant ship that crossed the Northern Limit Line (NLL), a maritime boundary between the rival states.
North Korea said rocket artillery had been used to deter the South Korean vessel, without specifying whether it was the same ship that fired warning shots.
“We ordered initial countermeasures to strongly expel the enemy warship,” a representative for the General Staff of the North's Korean People's Army said, according to the official KCNA news agency.
Analysts say a conflict on the peninsula, which has experienced a shaky ceasefire since the end of the 1953 Korean War, would be one of the most violent wars in recent memory, dwarfing even the Ukraine crisis in terms of casualties.
In 2017, a US Department of Defence simulation estimated that 20,000 people would die every day if a new conflict erupted.
South Korea’s Joint Chiefs of Staff issued a statement after Sunday’s exchange of fire, urging the North Koreans “to immediately cease consistent provocations and accusations which harm the peace and stability of the Korean peninsula, as well as the international community”.
Exchanges of fire between the two sides are rare, with the last serious clash occurring in May 2020 when troops fired at each other over the demilitarised zone.
The latest tension comes after the announcement of a joint US-South Korean naval exercise in the South’s territorial waters, which Pyongyang condemned as a provocation and a “threatening” act.
North Korea frequently conducts ballistic missile tests near South Korea and Japan, drawing international condemnation, and recently conducted what analysts said was a simulated nuclear attack on South Korea.