After two days of intense negotiation and frantic lobbying from the Scottish and Westminster governments, Jim Ratcliffe, the Swiss-based majority owner of Ineos, reversed his decision to shut the petrochemicals site. The closure would have resulted in 800 redundancies, put the adjoining refinery in jeopardy and caused severe damage to the economy of central Scotland.
Grangemouth employs 1,370 full-time staff and around 2,000 contractors, and supporting hundreds of local businesses. Workers punched the air and phoned their families as they streamed out of Friday morning's meeting, in which Grangemouth boss Calum MacLean announced Ratcliffe's about-turn. Ineos will now pump investment into a gas terminal that will receive cheap imported shale gas from the US.
Duncan Smith, an employee at the refinery, said: "It's great news for everybody in petrochemicals, but it's great news for the refinery too because we'd have had to look out for our jobs as well. We were all very worried about what the decision would be and when we heard the news there was a big cheer."
On Thursday, Unite accepted Ineos's "survival plan", which demanded an end to workers' final salary pensions, job cuts, a wage freeze and harsher redundancy terms. Only two days before, the union had declared victory over Ineos when the majority of its members voted against the company's proposals. Ratcliffe then dropped his bombshell and ordered the permanent closure of the petrochemicals plant, which was shut down along with the refinery on Wednesday as the dispute escalated.
Workers at the refinery knew that without its sister operation their jobs were also on the line and they told Unite to reverse its position.
On top of the Ineos plan, Unite agreed not to strike at Grangemouth for three years while management restores the loss-making plant to profit.
Ineos said the plant was losing £10m a month and that for the company to make £300m of required investment its workers had to forfeit their pensions, which it said cost an extra 65p for every pound paid in salary.
Despite the agreement, tensions still simmered between Ineos and the union.
Unite had rejected Ineos's claims that Grangemouth made a loss and accused Ratcliffe of using scare tactics to strip workers of their long-established working terms.
MacLean accused Unite of misleading its members. "If the union had taken the position they took in the last two days a week ago we might never have come to this and all this stress wouldn't have happened," he said.
Pat Rafferty, Unite's Scottish secretary, said: "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.
Grangemouth's importance spreads far beyond the Forth Valley where the town's 18,000 population live. It is Scotland's biggest industrial site and supplies plastics to car plants and other manufacturers throughout the UK.
It is also a totemic symbol as Scotland prepares for next year's referendum on independence. Scotland's first minister, Alex Salmond, has stressed the country's economic strength as he has campaigned to split from the UK.
Salmond described the announcement as a "tremendous fillip for the workforce and the whole Grangemouth community, following what could have been a potential disaster".
There was also relief in Westminster, where there had been concerns that the loss of a huge manufacturing plant could have pushed other companies that rely on Grangemouth out of the UK.
MacLean said Ratcliffe had spoken several times to Salmond and ministers in London as he debated whether to stick by Grangemouth. Ineos also asked for assurances that its application for a £9m grant from the Scottish government and a £150m UK loan guarantee were on track.
MacLean said: "Our concern was that after recent events there would still be a commitment from the [Scottish] government. I was worried that the government needed to realise they were putting money into an asset that had a long-term future and that if there was lots of industrial action going on they might not have seen things that way."
Local traders expressed relief that the plant, with its well-paid workers and huge needs for support and maintenance, would be saved.
Ami Carson, who works at the Rumbling Tum food van, where Grangemouth workers queue for burgers and rolls, said: "It's great for us. Now we don't have to be worried about our business not being as busy. I'm really happy for the boys keeping their jobs. Everybody will be in great spirits."
Nawaz Haq, who bought the lease to the Grange Lea Hotel to cater for Grangemouth contract workers, said: "Grangemouth isn't a tourist town and there's not a lot of other business so I was extremely anxious that I had invested in a project that would leave me indebted for a number of years."
Gary Horne, who runs the local Abbotsinch pub and restaurant, said: "If they had closed, the local economy would have been devastated. We'll be full tonight."
The dispute between Unite and Ineos was complicated by the position of Stephen Deans, a union official and longstanding Grangemouth employee who was accused and cleared of working to rig the vote for the local parliamentary candidate.
Ineos has conducted its own investigation into Deans's party activity on Ineos premises and its findings were due to be released on Friday, but MacLean said Deans had "asked for a few days".