David Cameron said on Thursday that Britain would be foolish to abandon an independent nuclear deterrent on the scale of Trident, pointing to the threat posed by North Korea, and other unstable regimes.

Cameron made his remarks (video)after visiting submarine HMS Victorious, one of the vessels that carry the Trident missile, as it returned from its 100th patrol – though his warning that North Korea posed a direct threat to Britain was later challenged by senior defence figures.

The prime minister's renewed backing for a like-for-like replacement for Trident appeared to be aimed at the Lib Dems and the Scottish nationalists.

Cameron, speaking to defence workers in Glasgow, said North Korea had missile technology that could threaten Europe, adding that the "noises" coming from Pyongyang were "worrying".

He said: "North Korea does now have missile technology that is able to reach, as they put it, the whole of the [US], so if they're able to reach the whole of the US they can reach Europe too. They can reach us too. I think the question we need to ask ourselves in the context of this debate about a nuclear deterrent, is what will a country like North Korea be like in 10 years, 20 years, 30 years?

"To me, having that nuclear deterrent is quite simply the best insurance policy you can have that you will never be subject to nuclear blackmail."

Cameron said he hoped a decision for Trident replacement would be made and that the missile would be based in Scotland. He said he was "very concerned" with the recent developments in North Korea, and urged Pyongyang to ensure "heat" was taken out of the situation.

"Obviously, it has extremely dangerous technologies in terms of nuclear and its weapons, it has a new and relatively unknown leader, and obviously the noises it has been making in recent weeks and months are worrying and threatening," he said. "North Korea should abide by all the UN resolutions which have been laid down. We do need to make sure that the heat is taken out of this situation. It is principally North Korea, almost entirely North Korea, who is able to do that and who ought to do that."

But Lord Ramsbotham, former deputy commander of UK land forces, said North Korea was not relevant to UK foreign policy and argued that the real problem facing Britain was whether it could afford to replace Trident.

"When you're looking at the national self-interest of the UK, the threat from North Korea simply doesn't enter into it, and we are looking at a quarrel, a dispute which involves North Korea, South Korea, Russia, China, Japan and the United States in a particular part of the world," he said.

"There is no evidence at all to suggest that the North Koreans possess a weapon which the prime minister suggested could pose a threat to Europe, or indeed to us".

Cameron had initially been visiting Scotland to underwrite the importance of Nato membership to Scotland.

Alec Salmond, the SNP leader, yesterday responded to the visit by saying: "What won't happen in an independent Scotland will be getting dragged into illegal wars and having Trident nuclear weapons dumped on the Clyde for another 50 years".

Labour has yet to set out whether it will support a like-for-like replacement for Trident. Shadow defence minister Kevan Jones said it was "absolutely right and necessary" for the UK to retain an independent nuclear deterrent, "but it must take into account the costs involved".

Liberal Democrat MP Sir Malcolm Bruce told Sky News: "We are saying we shouldn't replace Trident on a like-for-like basis but we are looking at alternative nuclear deterrents once Trident has passed its sell-by date."