SEOUL, July 21 (AFP) - Seoul told North Korea Friday that using its nukes would mean the "end" of Kim Jong Un's regime, after Pyongyang threatened nuclear retaliation over growing US military deployments on the peninsula.

Relations between the two Koreas are at one of their lowest points ever, with the North ramping up weapons testing as Seoul and Washington boost military cooperation.

Pyongyang's defence minister warned Thursday that this week's port visit of a US nuclear-capable submarine to Busan -- the first since 1981 -- could meet the legal threshold for the North to use its nuclear weapons.

North Korea last year adopted a sweeping nuclear law, setting out an array of scenarios -- some of which are vague -- in which it could use its nukes, including pre-emptive nuclear strikes if threatened.

As Seoul and Washington have "made clear" before, "any nuclear attack on the alliance will face an immediate, overwhelming and decisive response", Seoul's defence ministry said in a statement Friday.

Were this to happen "the North Korean regime will face its end", it added.

The US submarine's port visit is only a "legitimate defensive response" to Pyongyang's ongoing nuclear threats, it said.

That visit was agreed during South Korean President Yoon Suk Yeol's trip to Washington in April, when he and US President Joe Biden issued a similarly stern warning to Pyongyang about the terminal consequences of it using nuclear weapons.

South Korea's statement comes as an American soldier, Travis King, is believed to be in North Korean custody after crossing the border during a tourist trip to the Joint Security Area in the Demilitarised Zone on Tuesday.

Pyongyang has a long history of detaining Americans and using them as bargaining chips in bilateral ties. It has not yet issued any comment on King.

Announcing his new nuclear law last year, Kim Jong Un said the country's status as a nuclear power was now "irreversible", effectively eliminating the possibility of denuclearisation talks.

The new nuclear law is ambiguous, and claims Pyongyang could use its nukes if "an attack by nuclear weapons or other weapons of mass destruction... is judged to draw near".

Analysts have said this could be used to justify the North's possible nuclear use even in the face of conventional attacks.

"North Korea is the only entity that has adopted the Nuclear Forces Policy Act, which includes illegal preemptive strikes," Seoul's defence ministry said Friday.

Pyongyang is also "repeating actual preemptive strike drills and nuclear strike threats against" the Seoul-Washington alliance, it added.

Washington and Seoul also held their first Nuclear Consultative Group meeting in Seoul Tuesday, to improve their joint response to any nuclear attack by the North.