Eight military sites in Scotland will close in the next 16 years, cutting the defence estate by 20%, the UK defence secretary has announced.
Sir Michael Fallon said major Army bases at Fort George in the Highlands, Glencorse Barracks, near Penicuik, and Redford Cavalry and Infantry Barracks in Edinburgh would shut.
Stirling's Meadowforth Barracks and three other bases will also close.
They are among 56 sites which will shut across the UK.
Naval base MoD Caledonia in Rosyth, Craigiehall Barracks in Edinburgh and Forthside Barracks in Stirling will also be shut down.
Fort George, near Ardersier, will close as an active barracks in 2032.
The 18th Century artillery fort currently houses soldiers from the Black Watch (3 SCOTS).
The Black Watch battalion currently stationed there will be moved to another base in Scotland.
But Sir Michael also announced that Kinloss Barracks in Moray is to remain open for the foreseeable future.
The closing dates for the bases are Meadowforth Barracks - 2022, Redford Cavalry Barracks - 2022, Redford Infantry Barracks - 2022, Fort George - 2032, Glencorse Barracks - 2032, MoD Caledonia - 2022, Forthside Stirling - 2022, Craigiehall Scottish Army HQ - 2018.
The defence secretary told the Commons that the defence estate was ''vital, but too vast'' and too inefficient, and that the closures would help to deliver better value for money and allow the release of land to build 55,000 houses "where they are needed most".
He added: "We have been spending billions maintaining a defence estate that doesn't meet the needs of our Armed Forces. This plan delivers an estate fit for our forces and their families.
"By putting money where it is needed, we will provide better facilities to train our Armed Forces and deliver more stability for military families."
The SNP's defence spokesman at Westminster, Brendan O'Hara, said Scotland's defence facilities had been "hollowed out and sold out" because of the UK government's "obsession" with nuclear weapons.
Sir Michael responded by saying that the government was investing more in Scotland, with additional personnel being stationed at RAF Lossiemouth and work on eight Royal Navy frigates to begin on the Clyde next year.
Deputy First Minister John Swinney described the closures as "a huge blow" for Scotland.
He said: "Our defence footprint has been worn away through successive cuts, so it is unacceptable that the UK government has announced a near 20% reduction to our defence footprint. This comes just three years after the last Army Basing Plan, billed as offering stability and certainty.
"These brutal cuts spell the near total removal of the Army from large parts of Scotland and the end of the Royal Navy's presence in Fife. It is deeply distressing to witness the announcement to close truly historic sites, such as Glencorse, home to the Army for almost 150 years, and Fort George, a garrison for almost 250 years."
Margaret Davidson, leader of Highland Council, said the withdrawal of the Army from Fort George would take £20m out of the local economy.
Local businesses supply the site and there are about 200 armed forces families connected to the base.
Ms Davidson said: "Fort George is a huge symbol in Highland life. It is a presence of the Army in our community. It is going to be a great loss."
By Steven McKenzie, BBC Scotland Highlands and Islands reporter
What currently goes on behind the imposing walls at Fort George?
It is summer-time, and on a parade ground inside Fort George a soldier from the Crimean War is relaxing and tucking into a Cornetto.
Elsewhere, Roman legionnaires, chainmail clad knights, Jacobite fighters and government red coats mingle with young families and overseas tourists who have poured over a draw bridge into the fortification.
In an arena, the crowd is entertained by demonstrations of Viking raids and infantry drills from hundreds of years ago.
Major General Alastair Dickinson, who is the director of Army basing and infrastructure, described the announcement as "the right thing to do" from a military perspective.
He said: "It's incredibly sad and we're very conscious of this but the reality is - let's take Fort George as an example - we've got 21st Century soldiers. They need 21st Century equipment. They need 21st Century training and they need 21st Century accommodation.
"Fort George is a great monument. It's a great tourist attraction, but it's a listed building and it's very difficult to get it to the point where we can have 21st Century living and as a result we have got to move.
"From a military sense I think this is the right thing to do. We've got an estate that's too big. We've got to do something about it and we are doing.
"The way that this will work is that we will use three hubs of specialism and centres of capability. What we'll be able to do is put two or three regiments and the same sort of individuals together."
The Scottish government, SNP MPs and MSPs, Highland Council and the Moray Firth Partnership had been campaigning against the closure of the Fort George base after it emerged that the site formed part of a Ministry of Defence review of the UK's defence estate, along with Kinloss.
Fort George is managed by the Ministry of Defence and Scottish government agency, Historic Environment Scotland.
Large parts of the historic site are open to the public and more than 55,000 visitors take tours of the fortification every year.
The role of Fort George has been examined in previous rounds of defence cuts, including in 2011.
Fort George was built on the southern shores of the Inner Moray Firth on the orders of King George II following the Battle of Culloden in 1746.
It was a symbol of the Crown and was given the resources to crack down on fresh Jacobite rebellions, or risings.
Fort George would go on to provide a base for armed forces personnel training for D-Day landings during World War Two.
Today, the fort remains a working barracks and also houses the museum collections of the Seaforth Highlanders, The Queen's Own Cameron Highlanders and the Queen's Own Highlanders (Seaforth and Camerons).
RAF Kinloss was home to Nimrod surveillance aircraft before all of those stationed there were retired in 2010 and new planes were scrapped.
The site closed as an air station in 2012 and the Army now occupies the former air station.
RAF personnel and jet aircraft continue to operate from nearby RAF Lossiemouth.