IT looked unexciting at first, then developed into a drama – and at 5pm yesterday it became a crisis. The rejection of the Scottish Government's budget, on the casting vote of the Presiding Officer, took everyone by surprise.
Finance Secretary John Swinney has already submitted the £33 billion spending programme for parliament to reconsider, and the Government has proposed cancelling MSPs' half-term break next month to get a revised package passed.
Yesterday's events m
ean the threat of the Government resigning and the spectre of an unwelcome snap election now hover over Holyrood.
First Minister Alex Salmond says no government can continue in office if its budget is not accepted, and although Scottish Parliament rules would give Labour a chance to try to form an administration rather than spark an immediate election, Mr Salmond says in such a scenario it should be the people of Scotland who choose the Government.
After the shock of yesterday's vote, the chances must be that ministers will make sure they have a majority before a second attempt at getting approval for their spending proposals, which include accelerated investment in housing, schools and hospitals.
The budget defeat is the most serious setback yet for Mr Salmond since the SNP came to power in May 2007.
In the early stages of this year's process, it was widely assumed Mr Swinney would have little trouble in persuading people to back the government or abstain. The consensus was that no-one would want to be seen rocking the boat for party political advantage at a time of economic crisis.
Earlier this month, the budget passed its first hurdle by 107 votes to 16. Opposition parties warned there was no guarantee they would vote for the package, and while their comments were dismissed as posturing, positions hardened as the day of the crucial vote drew nearer.
The Lib Dems effectively wrote themselves out of the drama weeks ago by going all-out to argue for the Scottish Parliament to use its "tartan tax" powers to reduce income tax by 2p. That would mean £800 million of cuts – something the SNP was never going to agree to.
The Tories were seen from the beginning as the SNP's most reliable allies, and other opposition parties say after their apparent success last year in winning pledges on police, drugs and business rates, the Conservatives sold themselves too cheap this time round.
After the ridicule heaped on Labour last year, the party was determined to play its hand differently this time. There were several meetings with ministers where Labour pressed for more resources to help beat the economic crisis, and the logic was if that if these were not forthcoming, Labour would vote against the package.
The Greens, meanwhile, with just two MSPs, knew the budget was their best chance to press for radical pro-environment measures to be included in the Government programme.
They resisted the temptation of a green "shopping list" and concentrated on one simple, if expensive, proposal – a £100m programme of free home insulation, which they said would be good for the environment and create jobs.
Although the Greens had set out their proposals as long ago as October and talks had taken place, negotiations reached a climax in the run-up to yesterday's vote.
Patrick Harvie met Mr Salmond on Tuesday night, was on the phone to him yesterday morning, and had another 20-minute phone conversation ending just ten minutes before the debate started.
Mr Harvie was angry at the last-minute nature of the attempted deal-making, and when he was confronted by a television crew on his way into the debating chamber, he did nothing to hide his feelings.
He would not reveal if there was a deal, but he did say it was "disgraceful" the Government had left everything so late and was handling the budget in such a "haphazard" way, and said: "This is Scotland's budget and it should be done better than this."
Minutes later, Mr Swinney was announcing £60m for a town centre regeneration fund – a move to please both Labour and the Tories – and £22m for home insulation, intended to satisfy Mr Harvie.
The Green leader was called out of the chamber for a further word with Mr Salmond, but when Mr Harvie got his turn to speak, he branded the £22m "inadequate" and said he would vote against the budget unless that figure rose at least 50 per cent.
In his speech closing the debate, Mr Swinney spoke of "levering in" cash from partners like local authorities or regeneration firms to make the total £33m.
Opposition MSPs jeered at what looked like a last-minute capitulation. Still unconvinced, Mr Harvie wanted an assurance that if partners could not come up with the cash the Government would guarantee it.
Mr Swinney's reply – "The Government has said what it has said and it will ensure that it happens" – looked as if it might be enough to win the two Greens over, but when Presiding Officer Alex Fergusson read out the result of the vote it was 64-64 and he used his casting vote, as required by convention, for the status quo. Mr Harvie said there were "too many caveats" in the pledge and insisted the £33m had to be all new money.
The Greens' decision not to be bought off in the final few minutes was a bold move. While it should not take too much for the Government to reassure them, after yesterday's surprise no-one will predict what happens next.