NIGEL Farage's UK Independence Party was the biggest financial loser in the recent Aberdeen Donside by-election, failing to keep its deposit after spending almost £17 per vote - twice the level the SNP spent to win the seat.

Official candidate spending returns obtained by the Sunday Herald also show the SNP's spending was more than double that of Labour, suggesting the Nationalists were privately anxious about losing their heartland seat, but that Labour gave up the chase.

The SNP pumped almost £81,000 into getting Mark McDonald returned as an MSP in June, against just £36,000 spent by Labour on behalf of their candidate, councillor Willie Young.

Ukip was the third-biggest spender, blowing almost £19,000 on fifth place Otto Inglis. However, in terms of spending per vote, Ukip got by far the worst return for its money, with each of its 1128 votes costing it £16.77.

The SNP's 9814 votes worked out at £8.21 each, while Labour's 7789 cost £4.64 each. The SNP won by 2025 votes - a 70% fall in its majority despite turnout falling just 18%.

The Liberal Democrats spent £14,291 securing 1940 votes for candidate Christine Jardine, the equivalent of £7.37 per vote; while Conservative Ross Thomson polled 1791 after his party spent £9581, or £5.35 per vote.

The maximum spending allowed was £100,000.

Adam, who took the seat from Labour in 2003, had a 7175-vote majority in 2011, and the SNP were favourites to hold the constituency.

The by-election was called after the death of SNP MSP Brian Adam from cancer in April. McDonald, a North East SNP list MSP, resigned from Holyrood to fight the by-election.

Although the clear underdog, Labour initially talked up the potential of an upset for the SNP, an idea the Nationalists strongly dismissed.

However, the SNP were sufficiently concerned to spend more than 80% of the legal maximum, as a loss would have been seen as a major blow to their hopes in the independence referendum.

Of the £80,606 spent by the SNP, £65,312 went on more than 200,000 cards and leaflets for voters. By comparison, Labour spent £36,150 overall, of which only £14,411 went on election material.

Flushed with success from May's English local elections, where Ukip won around 25% of the vote where it stood and ended up with 150 councillors, Farage had hoped Aberdeen Donside could be a springboard for his anti-EU party north of the Border. However, his first appearance in Scotland, a press conference in an Edinburgh pub, descended into chaos after he was jeered by student protesters who called him a "racist scumbag".

Ukip candidate Inglis said the spending was worth it, because in politics, as in business, "you have to speculate to accumulate".

He told the Sunday Herald: "The real story of the by-election is that most parties did broadly how they did before, whereas Ukip came from nowhere to get over 1100 votes.

"Meanwhile, the SNP threw the kitchen sink at it and their vote slumped by more than 5000."

A Labour spokeswoman said: "That the SNP spent twice as much as Labour perhaps suggests that they thought they were going to lose and threw everything at their campaign to prevent that."

An SNP spokeswoman said: "The SNP ran the right campaign as our victory shows. Labour obviously struggled to raise funds."