BY THE time the polls closed for the crucial 2007 election, on Thursday 3 May, the contest was so tight no-one could predict which way it was going to go.
The first results came through from the urban areas in west and central Scotland, but these were Labour heartlands and they gave no real indication of the overall trend as Labour MSP after Labour MSP was returned.
But then the SNP started to make
inroads. Bruce Crawford took Stirling from Labour's Sylvia Jackson, Tricia Marwick triumphed over Labour's Christine May in Central Fife and Joe Fitzpatrick took Dundee West from Labour, defeating Jill Shimi, the leader of the council.
SNP deputy leader Nicola Sturgeon was jubilant after winning Glasgow Govan from Labour's Gordon Jackson – her third attempt to take the seat – and in the North-east seat of Gordon Alex Salmond triumphed, winning the seat from the Liberal Democrats.
These victories were not going to be enough on their own to secure the 20 or so seats the SNP needed to emerge as the largest party but they indicated a decisive swing in some parts of the country to the Nationalists. Everyone knew that everything would come down to the allocation of seats from the regional seats.
There were two crucial moments over the course of that long election night. The first happened in Ayrshire's Cunninghame North seat, where Allan Wilson, the Labour MSP, was trying to hold off a strong challenge by the Nationalists.
When the votes were counted, the SNP's Kenny Gibson emerged as the winner by just 48 votes. Wilson demanded a recount but this was turned down by the returning officer. There were 1,015 spoiled ballot papers in Cunninghame North, more than enough to have swayed the contest either way, but Gibson was named the winner.
The other, absolutely crucial, moment came right at the end of the counting process, at 5pm on Friday 4 May, a full 34 hours since the polls had opened.
Every other result except the Highlands and Islands list result had been decided by this point and Labour had 43 seats to the SNP's 45. With seven seats to be divided up, the entire election result was going to hinge on what happened in Inverness.
All the politicians had been up for almost two days without a break, everybody was showing their nerves and no-one knew whether Labour's Jack McConnell would hang on as First Minister or whether Salmond would get his chance to govern at last.
Salmond had arranged to fly in by helicopter to the lawns of the Prestonfield House Hotel in Edinburgh, hopefully for a victory press conference at 5pm.
He landed, waved to the press and went in to the hotel to consult his aides who confirmed there was still no result from the Highlands and Islands, so there could be no victory or defeat press conference.
Instead, Salmond went to the microphone and promised a full inquiry into spoiled ballot papers – a major problem which was turning into one of the big talking points of the election – if he became First Minister. There really was little else he could do.
Meanwhile, in Inverness, the returning officer called the candidates together and told them that the regional list votes had been counted and allocated as follows: four to Labour, two to the Tories and one to the Greens – with none to the SNP.
While the Labour candidates celebrated Dave Thompson, one of the SNP candidates, intervened.
He said: "I had been doing my own tally and reckoned we had 35 per cent of the vote, which meant we should have five seats (overall, list and constituency). It did not seem right we should only have the four constituency seats, the same number as Labour.
"So, just as the returning officer was about to get up on to the podium to announce the results I stood in his way to stop him. The resulting review of the result showed that the SNP list votes had not been counted and the party ended up with two regional list seats, Labour three and the Conservatives two."
As that review was taking place, Salmond was being driven to central Edinburgh, to the Hub, the brightly painted former church at the top of the Royal Mile.
As he was in transit, the Highlands and Islands result was announced. The overall result was now clear: The SNP had 47 seats to Labour's 46, the Conservatives 17, the Liberal Democrats 16 and the Greens two, while Margo MacDonald, the independent, got in again as well.
The margin of victory was as tight as it could be.
The SNP won 664,227 votes, 32.93 per cent, to Labour's 648,396, 32.15 per cent.
Every senior Nationalist who was heading to the Hub was listening in to the result. Former leader John Swinney had to stop his car on the Grassmarket to wipe the tears from his face.
Word spread through to the others, who were gathered, waiting at the Hub for what was now going to be a victory party. A cheer went up. There were more tears and hugs for party workers, new MSPs and activists.
Salmond arrived to a thunderous ovation, but he was deliberately conciliatory in tone.
He knew that the SNP had beaten Labour by the slimmest of margins.
Salmond also knew that the parliamentary arithmetic was so tight he would have to seek out a coalition if he was to govern with anything other than great difficulty.
So he sent out a message to the Liberal Democrats.
"I think there is a progressive coalition available which wants to take Scotland forward," he said.
Salmond added that he would introduce a new style of government.
"It's a difference of attitude and style, a difference of not how we approach the people who agree with us, but the people who remain to be convinced.
"I don't quite know how we are going to configure that coalition of the progressive forces, but we will go forward with an attitude which will look for the goodwill which I know is there."
It was clear that at this point, Salmond's favoured option was coalition government with the Liberal Democrats and possibly the Greens.
McConnell quickly conceded defeat, having made it clear during the election campaign that the party which emerged with the most seats would have the moral right to attempt to form an administration first.
The former First Minister stressed that while he recognised that the SNP was now the biggest party at Holyrood, this did not give Salmond the mandate to push for independence.
McConnell retreated to be with his wife and family, leaving the Nationalists to celebrate the closest election in Scottish history and the most ground-breaking.
Salmond knew that the nature of his administration, coalition or minority, and its course for the next four years, would be decided over the next few days.
He had been led to believe that there might be room for discussions on a possible SNP-Lib Dem coalition and he was keen to find out if that would work. There were other senior Liberal Democrats, however, who had very different ideas.
From Uncharted Territory: The Story of Scottish Devolution 1999-2009, by Hamish Macdonell. Published by Politico's on 11 May, £14.99.
One voting day, two elections, three ballots on two pieces of paper – and 145,000 spoiled votesDESPITE the historic nature of the SNP victory, the 2007 Scottish elections were also marred by so much confusion and so many mistakes that it resulted in the worst record of spoiled ballot papers in the country's electoral history.
At the polling stations voters were given two ballot papers. The first was split into two coloured sections. The first section, the regional ballot, contained the names of all the candidates and parties standing in the region and the first name on almost all was "Alex Salmond for First Minister".
The second section was for each constituency and listed the names of the candidates standing with their party. Voters were expected to mark a cross against one name on the regional list and a cross against one name on the constituency list. The second piece of paper, which was white, was for the local elections. It was at about this point that confusion started to set in for many voters. The white piece of paper contained a list of parties standing in the area and voters were asked to mark this one in order of preference: 1, 2, 3 etc.
Not only were there two different elections being held on the same day, with three separate ballots on two different pieces of paper, but three different electoral systems were being used: first-past-the-post for constituency elections, the list system for regional top-up seats and single transferable vote for council elections.
To make matters worse, the ballot papers had been standardised to make sure they fitted the electronic counting machines and some authorities found they had so many parties standing they had to trim the voting advice on the top of each page so voters were not told exactly what they had to do.
Even more confusing was the decision to make the regional vote the "first" vote. This was done to counter the Greens, who campaigned successfully in 2003 on the slogan "second vote Green", and to make sure the regional list vote was seen as a vote in its own right, not a second-chance vote.
But what all this meant was that thousands of voters ended up bewildered.
By the time the polls closed, there were 145,000 spoiled papers.