BiFab was close to administration three times last week
An agreement was made over the weekend to save it from closing up
The firm has been secured work until next April after the Scottish Government steeping to prevent BiFab going into administration.
Troubled engineering firm BiFab was on the brink of administration three times last week as intensive talks to secure its future took place, Scotland's economy secretary has said.
An agreement was reached on Saturday that will lift the threat of administration from the firm, and see work continue on the current contract for the Beatrice Offshore Windfarm.
A financial package to complete the contract has been provided by Seaway Heavy Lifting, SSE and the partners to the Beatrice Offshore Windfarm project, JCE Offshore.
Economy Secretary Keith Brown MSP said the agreement will secure work until next April and that efforts are under way to identify other contracts and secure the long-term future of the company.
The Scottish Government has also indicated, if necessary, it will make a commercial loan facility available to BiFab.
Mr Brown told the BBC Sunday Politics show: It is very good news. What the deal we have done allows us to do is to see through the contract right through to April next year and keep people employed to do that.
What we have to do now, and we're actively involved in this with some very promising early signs, is make sure they can win further work for the yard, that we can see additional capital investment going in and further training of the workforce.''
Burntisland Fabrications Ltd (BiFab), has a workforce of 1,400 employees, contractors and subcontractors at its yards in Burntisland and Methil in Fife and Arnish on the Isle of Lewis.
The company, which makes equipment for the oil and gas industry and the renewable energy sector, filed a notice of intention to appoint administrators a week ago as it faced cash flow problems linked to its contracts.
Mr Brown said: During the week we three times had to stop BiFab from going into administration. They had to have a deal.
They could not sustain a situation where they had people working without wages so they were on the brink three times last week and we've managed to avoid that and also now to give added certainty that these contracts will be seen through till April.''
The agreement will see Burntisland Fabrications Ltd (BiFab) receive payments to alleviate immediate cash flow issues, enabling the threat of administration to be lifted and ensuring the full funding of the Beatrice contract.
First Minister Nicola Sturgeon said: I am pleased that after an extensive series of talks over the last week and two days of intense negotiations we have been able to broker a commercial agreement that lifts the threat of administration from BiFab and allows work on the current contract to continue.
Trade unions GMB and Unite praised the role of the Scottish Government and Ms Sturgeon in brokering the deal, and the resolute stand taken by the BiFab workers to convince everyone they were determined to fight for their jobs and their communities.
Jan Willem van der Graaf, chief executive of Seaway Heavy Lifting (SHL), said: We have worked very hard along with the other stakeholders to find constructive solutions to support BiFab.
We appreciate the role that the Scottish Government has played in reaching a positive solution for all.
Seaway Heavy Lifting will continue to always treat its suppliers fairly, with respect and integrity and we look forward to BiFab successfully completing the remainder of the Beatrice jacket fabrication.''
Scottish Secretary David Mundell welcomed the news and said: It will be a huge relief to BiFab's 1,400 employees and their families.'