The owners of the giant Grangemouth petrochemical site have decided to keep it open, saving thousands of jobs from being lost.
The move followed acceptance by the Unite union of a survival plan, including a pay freeze, ending of the final salary pension scheme and other changes to terms and conditions.
Ineos had said it would close the site, which employs 800 employees, after workers refused to sign up to the changes.
But it said it would immediately reopen the site and the adjoining oil refinery, which have been shut down for the past week as a result of the dispute.
A number of contractors have been laid off or switched to other sites.
Workers heard the news at a meeting with managers this morning.
Politicians from the UK and Scottish governments have been pressing the two sides to break the deadlocked row, warning of the grim impact on the economy if the plant had closed.
Unite's general secretary Len McCluskey met shop stewards and managers at Grangemouth yesterday after announcing that the union had decided to "embrace" the survival plan.
Ineos has said the site is losing £10 million a month.
Calum MacLean, Grangemouth chairman said: "Unite risked 800 jobs and one of the UK's largest manufacturing facilities over a union official investigation before any verdict had been announced.
"It then advised employees to reject the change essential to the survival of Grangemouth. Today's U-turn means Grangemouth now has an excellent future."
Ineos said in a statement: "Unite's withdrawal of its opposition to the company's survival plan , which was already supported by 50% of employees on the site, has allowed the shareholders to invest a further £300 million in the company.
"This money will be used to fund ongoing losses and to finance the building of a gas terminal to bring in shale gas ethane from the USA.
"The Scottish government has indicated it will support the company's application for a £9 million grant to help finance the terminal and the UK Government has given its prequalification approval for a £125 million loan guarantee facility."
Jim Ratcliffe, the chairman of Ineos Group, said: "This is a victory for common sense. Unite advised employees to reject change and vote for closure. Thank goodness people finally came to their senses. Grangemouth now has a great future."
Ineos said Unite had made a "dramatic U-turn" and had agreed to a three-year pay freeze, no strikes for three years, moving to a "modern" pension scheme and changes to union agreements on the site including no full-time union convenors.
Downing Street said Prime Minister David Cameron's priority was to ensure the business survived.
"Any progress in that direction is very encouraging," a No 10 spokesman said.
The spokesman said the Government had been working "very closely" with the Scottish Government on the issue.
Scotland's First Minister Alex Salmond said: "This news is a tremendous fillip for the workforce and the whole Grangemouth community, following what could have been a potential disaster.
"It's been a great team effort from all concerned, including the unions and workforce, the management, Governments - and BP, who have made a material contribution to help defend and secure Scottish jobs and livelihoods.
"I am delighted that people have rallied round to protect these jobs, and now we can all agree that Grangemouth has an outstanding future.
"Clearly for many people across the communities of the Forth Valley, Wednesday was a day of despair - today is quite different, and is a day of great satisfaction that not only has a key part of Scotland's industrial infrastructure been saved but that people can look forward with confidence to a bright future.
"There will no doubt be continued debate and recrimination in some quarters about why the future of this facility went so close to the cliff edge.
"However, as First Minister, I prefer to stress the positives including the fact that so many people have gone the extra mile to secure Grangemouth's future."
Scottish Secretary Alistair Carmichael said: "This is the news that we all wanted.
'The staff and their families have been through a very stressful and uncertain time. They have been through a hell of a week and I hope they have a much better weekend as a result of today's announcement.
'They can look to the future with an optimism which was absent earlier in the week.
"This is the outcome we have worked towards and one which Scotland and Grangemouth deserve.
"There are undoubtedly lessons to be learned from this dispute but for now we should focus on the immediate success of securing the site's future.
"The joint talks at Ineos yesterday have been just one part of the UK Government's efforts to find a solution to this crisis.
"The UK guarantee for the new ethane facility is an important part of the discussions and the plant will be a key part of the company's plans for the future."
Unite's Scottish secretary, Pat Rafferty, said: "This decision is clearly very welcome. Relief will ring right round the Grangemouth community, and across Scotland today. Hundreds of jobs that would have been lost can now be saved and £300 million will be invested into the plant.
"Grangemouth is the powerhouse of the Scottish economy - it now has a fighting chance of upholding this crucial role into the future.
"Obviously today's news is tinged with sadness - decent men and women are being asked to make sacrifices to hold on to their jobs, but the clear wish of our members is that we work with the company to implement its proposals.
"Unite has worked tirelessly to save Grangemouth because we are totally committed to this plant and its incredible workforce. We will now sit down with Ineos to consult on the company's propsals."
Mr MacLean told a press conference: "We are very happy to announce that following a meeting with shareholders yesterday, Grangemouth petrochemicals will remain open, so that decision has been reversed.
"Ineos have confirmed that the £300 million that they are going to put into it will be available and we will start immediately with those projects again.
"We've also confirmed that with immediate effect, with due respect to all the safety and the timing, that all the assets will start as of today."
It is understood employees greeted the announcement with cheers when they were told the news.
Mr MacLean said the decision was taken following a meeting with shareholders last night in the wake of "a very clear message" from the employees and Unite.
He told the press conference: "This company has invested £1 billion into these assets over recent years and now they've confirmed they're going to invest another £300 million, so it's a huge investment and that investment was only rightly to be done if we had a long term sustainable base.
"What we've now done through this project is given the chemicals business another 15-20 years on the back of new raw materials and new contracts and significant investment."
Mr MacLean said no additional concessions had been demanded of the union by the firm.
"The union have simply agreed that there will be no strike action during this consultation, or around any discussions on the survival plan," he said.
"We will have that consultation period with the employees direct and we will also have that consultation period with the independents and the unions with a view to implementing the changes on the survival plan at the end of that period."
He did not rule out the possibility of some job losses but said any redundancies would be "very limited".
He said: "We would not dismiss that there would not be some redundancies, but having got the investment on the back of this announcement, redundancies will be very limited."