Labour dramatically overturned the Scottish National party's (SNP) majority in the Dunfermline by-election last night, in a move which casts further doubt on Alex Salmond's ability to win the Scottish independence referendum next year.
The by-election for the Scottish parliament, which was sparked by the jailing of sitting MSP Bill Walker for domestic abuse, saw Labour beat the SNP by nearly 3,000 votes.
The SNP took Dunfermline as part of its landslide election win across Scotland in 2011, with a majority of 590.
A seven per cent swing saw Labour take the seat with a majority of 2,873, winning 42.4% of the vote to the SNP's 30.6%.
Both parties threw huge amounts of resources at the seat, in the knowledge that the result would give momentum to the victor ahead of next year's referendum.
Labour sources privately suggested that tactical voting from Conservative and Liberal Democrat supporters may have helped swing the vote further in their favour in what was acknowledged to be a two horse race.
The Liberal Democrats came third in the contest with 11.79% of the vote and the Conservatives came in at fourth place with 8.3%.
The SNP are likely to point to the mid-term timing of the by-election to explain the loss, but privately officials will recognise that it does not stand the party in good stead ahead of next year's referendum.
"We need a Scottish government that will address the needs of Scots, not one that will simply make promises about what will happen after 2016," Labour candidate Cara Hilton said.
"Today Dunfermline has sent a message to Bute House and Alex Salmond: It's time for you to focus on the real priorities of Scots, not your constitutional obsession."
Liberal Democrat candidate Susan Leslie said: "I think it has been a victory for women in politics in Scotland that four women stood in this by-election and fought positive campaigns on the issues for Dunfermline."
Turnout was 42.65%.