Admiral Sir Mark Stanhope, former first sea lord and chief of naval staff, has sent a letter to First Minister Alex Salmond co-signed by former heads of the army, navy, air force and intelligence warning that the SNP's proposed constitutional ban on nuclear weapons "would be unacceptable for Nato".
Scotland would be "a new small nation in an uncertain world" in need of allies, but Nato "could hardly be expected to welcome a new member state whose government put in jeopardy the continued operation of the UK independent nuclear deterrent", Sir Mark said.
"Many, if not most" of the 7,000 staff employed at Faslane and Coulport "would lose their jobs", he added.
He criticised the Scottish Government's White Paper on independence, which was published in November last year.
The letter states: "The White Paper admits that this part of their plan has been drawn up with the help of the unilateralist Campaign for Nuclear Disarmament.
"For the continuing UK such a demand, not least in the time-scale envisaged, would cause huge practical problems and upheaval for the Royal Navy and require massive additional expenditure - running into many billions of pounds - and would be deeply resented by many.
"The negotiations with Westminster following a Yes vote, covering such vital matters as currency, financial settlements and re-allocating existing UK defence and other assets, can be expected to be complex and difficult.
"If the very future of the UK nuclear deterrent was also in the balance, it would inevitably sour those negotiations.
"Were the Scottish people to vote for independence, then Scotland, as a new small nation in an uncertain world, would need international partners to help secure its economic and social objectives and allies to provide national security.
"Nato, as an Alliance with nuclear deterrence as a central part of its strategic concept, could hardly be expected to welcome a new member state whose government put in jeopardy the continued operation of the UK independent nuclear deterrent - a deterrent which protects not only the UK but all of Nato as well.
"The United States and France as two of the P3 nuclear powers could be expected to be particularly concerned at the risk that an independent Scotland was effectively pushing a unilateral nuclear disarmament agenda that they and Nato have consistently opposed.
"They would also view with alarm the White Paper suggestion of a constitutional ban on nuclear weapons in Scotland - a move which would be unacceptable for Nato allies.
"The consequences for negotiations with the continuing UK for EU and Nato membership are impossible to predict, but the very prospect of implementing the Scottish Government's policy would cast a dark shadow over the international reception given to a newly independent Scottish nation."
The letter is also signed by former chiefs of the defence staff Air Chief Marshal Lord Stirrup, General Lord Walker, Admiral the Lord Boyce and Field Marshal Lord Guthrie; first sea lords and chiefs of the naval staff Admiral Sir Jonathon Band, Admiral Lord West of Spithead, Admiral Sir Nigel Essenhigh, Admiral Sir Jock Slater; former chief of the general staff General Sir Mike Jackson; former chief of the air staff Air Chief Marshal Sir Peter Squire; and former permanent secretary and security and intelligence co-ordinator at the Cabinet office Sir David Omand.
A Better Together spokesman: "This is a stark warning from military experts with years of experience.
"Leaving the UK would cost thousands of jobs in Scotland's defence industry, and mean we would need to reapply to join Nato and the EU. The idea that everybody would stand aside and agree to everything Alex Salmond wants isn't credible. It is now beyond doubt that we are stronger and better together."
Head of Better Together Alistair Darling said: "I think these retired officers are making the point that, ironically, Nato is a nuclear alliance which the Nationalists now want to be in, and Trident is an important part of that.
"What these officers is doing is simply expressing a concern that once you start these changing things - and we live in an extremely uncertain world at the moment - then you take on added risks and uncertainties that frankly the world doesn't need."
A Scottish Government spokeswoman said: "Faslane has a strong future as a conventional naval base, and as the joint headquarters for the defence forces of an independent Scotland - and we have made clear that the number of military personnel employed there post-independence will approximately match current numbers.
"The estimated £170 million that Scottish taxpayers contribute every year to the maintenance and running of Trident could be far better spent by prioritising our conventional defence needs.
"An independent Scotland will be warmly welcomed into the international community of nations, and our position on Trident and nuclear weapons is in keeping with that of many of our friends, neighbours and allies.
"It is in Scotland, the rest of the UK and Nato's mutual interests for Scotland to be a member. Only three Nato members are nuclear-weapon states, and 20 of the 28 member states neither possess nor host nuclear weapons."
She added: "With independence, Scottish defence spending will provide security as well as increasing economic benefits and employment on which we currently miss out.
"As set out in Scotland's Future, an independent Scotland focusing on a strong - non-nuclear - conventional defence footprint with an annual defence and security budget of £2.5 billion would provide for significant investment in the defence sector and support key Scottish industries including shipbuilding."