Prestwick Airport has passed into public ownership after being bought by the Scottish government for £1.
The facility, which was put up for sale last year by New Zealand firm Infratil, has incurred annual losses of £2m.
It is understood a deal was concluded late on Friday. It is expected the airport will continue to operate as normal and there will be no job losses.
Deputy First Minister Nicola Sturgeon said the deal would help protect the airport and the jobs it supported.
She told BBC Scotland that work would now begin for "turning Prestwick around and making it a viable enterprise".
She said: "It's a good decision and I'm glad we've reached this outcome, because it allows us to protect not just the asset of Prestwick Airport but the jobs that directly and indirectly depend on it."
Ms Sturgeon said the full terms of the agreement with Infratil and the Scottish government's business plan for the Ayrshire facility would be made public at a later date.
She added: "This is not a decision we have taken lightly.
"We would have preferred to see a private company buy Prestwick Airport but the strategic and economic importance of Prestwick Airport is such that we weren't prepared to see Prestwick close."
The deputy first minister said the government would run the airport on "a commercial basis" and do everything it could to return it to profit as soon as possible.
She said the long-term goal was to return it to private ownership but said, realistically, it may take "some time" to have the airport running profitably.
"First and foremost we need to make sure that the airport is operating on the right basis," she said.
"We've made clear our intention to have a separate company to run the airport for us."
The deal was welcomed by the leader of South Ayrshire Council, Cllr Bill McIntosh.
He said: "The airport is vital to the local and national economy and this excellent news will be a huge relief for the 1,400 people employed there - and for those companies directly involved with the freight, training, maintenance and repair operations at the site, supporting an additional 3,200 jobs.
"The transfer of ownership, just before Christmas, could not have come at a better time for the staff and families whose future looked less than certain a few weeks ago."
However, the viability of the Prestwick deal has been questioned by the leader of Glasgow city council.
Councillor Gordon Matheson said: "While I've said that I support efforts to save jobs at Prestwick, I'm still unclear how the Scottish Government can build a sound business case for Prestwick as a passenger airport without skewing the market at Glasgow's expense.
"Given Prestwick's significant annual loss under its previous owners and the fact that no private investors considered it a viable acquisition, it is difficult to see how the Government can make it a success as a passenger airport within State Aid rules."