The government had been looking at either closing the Tornado bases of RAF Lossiemouth in Moray or RAF Marham in Norfolk.
Tornado operations were to be relocated to the base remaining open.
But the government has decided to keep both operational.
But RAF Leuchars will close and become an army base, with its Typhoons leaving for Lossiemouth in 2013 and the army starting to move in later.
Concern over RAF Marham's future prompted a major campaign to save the base by councils, MPs and business leaders in Norfolk.
South West Norfolk MP Elizabeth Truss, a campaigner to save RAF Marham, said: "I am absolutely delighted.
"The campaign was not just based on a simple fondness for the RAF, it was founded on sound economic and strategic principles and I believe that resulted in the decisive decision to make it Marham."
In the House of Commons, Defence Secretary Liam Fox praised the work of Ms Truss in the fight to save RAF Marham.
Broadland MP Keith Simpson said: "This is excellent news for the RAF and defence of the country and a relief for people of Marham and Norfolk."
The Tornado base at RAF Marham in Norfolk threatened with closure under the government's defence review will stay open, it has been announced.