Scotland's first wave power company has been saved from going under after being bought out by a German firm.
Wavegen built the world's first grid-connected wave power station
Wavegen in Inverness was close to closing and had issued redundancy notices to its 15 staff.
However, a takeover by Voith Siemens Hydro means only three staff will lose their jobs and the company will continue to operate.
The Scottish National Party said more should be done to ensure such companies are not sold to foreign firms.
But ministers argued that Scotland was "at the forefront of the global development of marine energy".
Despite the new overseas owners, Wavegen will retain its Highland base where it will continue to carry out research and development into wave energy systems.
The company was founded in 1990 and built the world's first grid-connected wave power station, the Limpet, on Islay off the west coast of Scotland.
A spokeswoman for Wavegen said: "The buyout is very good news for the company and means it will continue to operate as normal.
"It will remain in Inverness and all the staff redundancies will no longer be carried out."
Its new owners are part of the Voith group, which is one of Europe's largest family-owned companies.
However, SNP environment spokesman Richard Lochhead said Scotland should be leading the world in developing renewable energy technology and not have its companies subject to foreign control.
Mr Lochhead said: "This is hard evidence that the executive and the UK government have failed to capitalise on Scotland's technical expertise and huge renewable potential and are failing Scottish companies.
"Scotland should be the renewable powerhouse of world.
"Instead, other countries are enjoying the benefits of our resources and technical expertise."
Last week Leith-based Ocean Power Delivery (OPD) signed a £5.5m deal to develop what is said to be the world's first commercial scale wave farm in Portugal.
However, Enterprise Minister Jim Wallace said Scotland was not falling behind the competition.
"Wavegen will continue to be based in Inverness and we had always hoped that Scottish companies like OPD would achieve orders for overseas locations," he said.
He said such companies were able to enjoy success abroad because of the support and facilities available in Scotland.
Mr Wallace pointed out that the executive had invested more than £3m in the European Marine Energy Centre (EMEC) in Orkney.
"However, marine energy is not being developed in a bubble that confines it to Scotland. We must acknowledge and work with international developments," he said.