Scottish ministers are to take Prestwick airport into public ownership in an attempt to rescue the ailing site after years of losses.

Nicola Sturgeon, the deputy first minister, said her officials were in talks with Prestwick's New Zealand-based owner, Infratil, to discuss a buyout. The site is a hub for the budget airline Ryanair and a strategic refuelling base for Nato aircraft.

One of Scotland's best known airports, Prestwick is where Elvis Presley is reputed to have touched UK soil for the first and only time, in 1960. But its relative isolation in south Ayrshire means it has struggled to compete against its close rival Glasgow international airport.

Once kept afloat by the budget airlines Go and Ryanair, it was put up for sale in March last year after running annual losses of £2m, but none of the prospective bidders were able to strike a deal with Infratil.

Passenger numbers peaked at 2.4 million in 2007 but have since slumped to just over one million a year, leaving Prestwick trailing behind Edinburgh, Glasgow and Aberdeen.

Sturgeon told the Scottish parliament that Infratil had been considering several options including the airport's closure. That would be a "serious and unwelcome development" for Ayrshire and the wider Scottish economy, with 300 jobs at the airport and another 1,100 jobs indirectly linked to it.

"We believe Prestwick airport can have a positive future," she said. "It will require investment and it will take time. However, we believe it can be returned to profitability. We also estimate that the cost of closure to the public purse would be very significant and this is an important factor in our decision."

She dismissed fears that ministers were venturing into difficult territory, since the Scottish government already owned 11 small regional and local airports such as Inverness through Highlands and Islands Airports Limited.

Other regional airports including Manchester, Stansted, Newcastle and Cardiff were owned wholly or substantially by public sector bodies such as local councils, Sturgeon said. In addition to the passenger airport, there were 1,800 jobs tied to the aerospace industry cluster at the site.

"I can therefore advise parliament that the Scottish government has advised the current owners of our intention to commence a process towards acquisition of Prestwick airport. Following the agreement of its board earlier today in Shanghai, we are entering into negotiations with Infratil for the potential acquisition of Prestwick Aviation Holdings Limited and its subsidiaries."

The airport's local MSP, John Scott, who is also one of Holyrood's deputy presiding officers, said he was pleased that ministers were stepping in, provided that the government aimed to sell it back into private hands once it became profitable again.

"I believe an opportunity now exists to return Prestwick airport to profitability, and ultimately to private ownership, as the upturn in the economy continues and passenger and freight volumes increase," he said.

Alex Johnstone, the Scottish Tory transport spokesman, said ministers had to safeguard public money and be robust if they failed to make it viable. "It is going to take an enormous effort to get the airport back into profit and make it sustainable for the future," he said.

"That will involve a significant level of restructuring and the Scottish government has to have the courage to do what's necessary rather than simply pouring money into something without accruing any benefit."