Media playback is unsupported on your device Media caption David Cameron: "Obviously the noises it (North Korea) has been making in recent weeks and months are worrying and threatening"

The UK would be "foolish" to abandon Trident in the face of the potential threat of nuclear attack from North Korea and Iran, David Cameron has said.

Writing in the Daily Telegraph, he said the country still needed the "ultimate weapon of defence".

The prime minister said the nuclear danger had "increased" since the end of the Cold War.

The Lib Dems want the UK to explore a cheaper alternative to the Tories' £20bn plan to replace Trident.

Mr Cameron is committed to maintaining a round-the-clock submarine-based nuclear missile system of the kind Britain has had since the late 1960s.

But the Lib Dems have insisted the coalition carry out a review of cheaper submarine or land-based options, including abandoning round-the-clock patrols.

'Nuclear blackmail'

Labour, which was committed to a like-for-like replacement for Trident when it was in power, has now said it will examine the outcome of that review.

The prime minister also stressed his commitment to Trident, which is based on the Clyde, during a visit to the west of Scotland.

"The world we live in is very uncertain, very dangerous: there are nuclear states and one cannot be sure of how they will develop," he told workers at a defence contractor in Glasgow.

"We cannot be sure on issues of nuclear proliferation, and to me having that nuclear deterrent is quite simply the best insurance policy that you can have, that you will never be subject to nuclear blackmail."

The (Scottish) parliament and 80% of the people of Scotland want to get rid of Trident Angus Robertson, SNP defence spokesman

Mr Cameron had earlier visited HMS Victorious, one of the Royal Navy's four Vanguard-class submarines which keep Trident nuclear missiles continuously at sea, which is returning from its 100th patrol.

"I wanted to come on board and congratulate everyone who's been involved in those hundred tours and to say a big thank you to all those people so work so hard to keep us safe," he said.

The Scottish National Party has said it would not allow nuclear weapons to be based in Scotland, should next year's referendum support independence, a move that would potentially add billions to the cost of replacing Trident.

In the Daily Telegraph article, which was published ahead of his trip, Mr Cameron said the "highly unpredictable and aggressive" regime in North Korea was developing ballistic missiles that could become a threat to Britain.

He said: "We need our nuclear deterrent as much today as we did when a previous British government embarked on it over six decades ago.

"Of course, the world has changed dramatically. The Soviet Union no longer exists. But the nuclear threat has not gone away.

"In terms of uncertainty and potential risk it has, if anything, increased."

Mr Cameron said: "North Korea recently conducted its third nuclear test and could already have enough fissile material to produce more than a dozen nuclear weapons.

"Last year North Korea unveiled a long-range ballistic missile which it claims can reach the whole of the United States. If this became a reality it would also affect the whole of Europe, including the UK."

The prime minister questioned whether anyone would "seriously argue that it would be wise for Britain, faced with this evolving threat today, to surrender our deterrent".

"My judgement is that it would be foolish to leave Britain defenceless against a continuing, and growing, nuclear threat," he said.

Defence work

Shadow defence minister Kevan Jones said it was "absolutely right and necessary" for the UK to retain an independent nuclear deterrent but the cost needed to be taken into account.

"World events demonstrate that in an unpredictable era our country needs the ultimate security guarantee," he said.

"The precise nature of the deterrent must be judged on meeting military capability requirements and cost."

Mr Cameron has also spoken about the role of Scottish companies in supplying the UK's armed forces.

He described the work as more "secure" when it was as part of the United Kingdom, he said "defence jobs matter".

The SNP has claimed it would be a mistake for the UK government to place the Trident nuclear programme at the heart of its case for the union.

Defence spokesman Angus Robertson said: "The (Scottish) parliament and 80% of the people of Scotland want to get rid of Trident, and the obscene waste of up to £100bn it represents at a time of austerity and savage welfare cuts from Westminster."

Trident's Faslane base currently employs 6,700 military and civilian workers with that figure due to rise to 8,200 by 2022.

UK nuclear capability The four Vanguard submarines which host Trident missiles can attack targets within a range of just over 4,600 miles (7,400km). The example above shows this range if the sub were located in the mid-Atlantic.

Meanwhile, the US has announced it is moving an advanced missile defence system to the Pacific island of Guam - where it has a significant military presence - amid heightened tensions on the Korean peninsula.

It came as North Korea said the use of nuclear weapons by its military had been ratified.

North Korea has threatened attacks on the US and South Korea in recent weeks.