Deputy first minister, Nicola Sturgeon, said the government took the decision when it became clear no private investor was able to commit to buying the airport on a timescale that was “acceptable” to current owners Infratil.

Now the government has pledged to return the airport to profitability, and safeguard thousands of jobs.

Ms Sturgeon said: “Prestwick Airport’s importance to the local Ayrshire and wider Scottish economy cannot be overstated – and it is vital that all efforts are made to keep the airport open.”

The surprise announcement was made to MSPs on Tuesday, October 8.

Even those in the know about goings on at the airport were caught off guard when the news leaked.

But while some are saddened that the government has been forced to step in, Ms Sturgeon insists the move will secure the future of the airport, which has been running losses of £2 million.

Prestwick Airport has been on the market for nearly two years but a suitable buyer has never been found.

The final deal between the Scottish Government and New Zealand-based Infratil has not yet finalised so no figure has been put on the sale.

But Ms Sturgeon estimated the deal to be complete within six weeks.

Ms Sturgeon said: “Over the next few weeks we will focus on due diligence, legal and commercial issues around public ownership and the development of a business plan that will allow Prestwick to thrive once again.”

She added: “We believe Prestwick Airport can have a positive future.

“It will require investment and it will take time.

“However, we believe it can be returned to profitability.”

Around 300 people are directly employed by the airport, with 1400 more associated with the facility, such as maintenance workers.

The Prestwick aerospace industry also employs about 3200 people.

And the government said these jobs should all be protected now.

Marko Bogoievski, chief executive officer at Infratil, said: “In March 2012 Infratil announced its intention to sell its two UK airports, Glasgow Prestwick Airport and Manston Kent Airport as part of a process to refocus its investment profile.

“Recognising the importance of the airports to their local communities, Infratil’s preference has been to secure a new owner with the capacity to support their future success.

“We believe that a Scottish Government acquisition of Glasgow Prestwick Airport achieves that objective and will work pro-actively with the Scottish Government over the next six weeks towards achieving completion of a transaction.”