Labour did everything right to secure the victory, while the SNP waged an aggressive campaign which limited the damage of fighting a no-hope seat where they had never had a record until an obscure wife-beater came along and wrecked their progress. It will be a long way back for the SNP in the area of West Fife where they had no pedigree until they capitalised on the LibDem collapse two years ago to come through the middle and win.
At this election Labour just needed to play it safe, keep calm in the face of a tough onslaught from their SNP opponent, and protect their relatively inexperienced candidate. They could then rely on the near certainty of some degree of swing against a mid-term Government to do their work for them.
One per cent would have done it but they achieved nine per cent in the Nationalist bastion of Aberdeen Donside, so they were bound to do at least as well in Dunfermline. As the boxes came in from the old mining villages of West Fife it was clear that the Labour vote had turned out.
Suddenly, late at the count, Labour people began to relax, which was good, and by the declaration they were triumphant, which may have been less advised. The SNP's Shirley-Anne Somerville deserves credit for stopping the rot caused by Bill Walker. A seven-point swing to Labour was not the catastrophe for her party it might have been, given the nine-points shed recently in a heartland such as Aberdeen Donside.
Labour and the SNP both fought tough, impressive campaigns, the former by picking a candidate and shielding her - there is no shame in being an inexperienced, protected candidate - although she would have been better served if her acceptance speech had sounded less sour.
It was a sweet family revenge for Cara Hilton. Two years ago the SNP landslide claimed her mother, Cathy Peattie's Falkirk East constituency.
However, Labour should avoid reading too much into this result as there were too many sub-texts to this battle: The Walker factor, the solidly Labour hinterland, and a Government in mid-term. It was a good night, but they shouldn't get carried away. The SNP should strike Shirley-Anne Somerville a medal. When the drums sounded, she marched towards the gunfire in an unwinnable situation.
The Liberal Democrats actually claimed this as a good result. A slump from 33% to 11% in six years, it's hard to see how. The Tories on the other hand actually did increase their share of the vote and that was with a 22-year-old up against Scotland's Ukip organiser, who lost his deposit. Most would count that as a result.