Labour have regained the Dunfermline and West Fife seat they sensationally lost to the Lib Dems in the by-election disaster of 2006.
Thomas Docherty walked away with a majority of 5470 after ousting the sitting MP Willie Rennie.
Mr Docherty polled 22,639 votes, beating Mr Rennie into second place with 17,169 votes.
The Tories came third, the SNP fourth as their vote collapsed and UKIP last.
Mr Docherty said, “We do not know the result of the General Election yet, but people have spoken clearly in west Fife, in Kirkcaldy and in Glenrothes that Gordon Brown remains our favourite son.
“I am humbled by the trust placed in me this evening.”
It was a triumphant night for Labour in what is traditionally seen as their heartland, but they were pushed hard by the Lib Dems.
They scored one of the biggest by-election upsets in Scottish political history back in 2006 when they took what was once regarded as a rock-solid Labour seat.
That by-election was called following the death of Rachel Squire, who won at the previous year’s General Election.
She had a whopping 11,562 majority, but Mr Rennie and his team blitzed the by-election campaign trail.
He ended up with a majority of 1800 and has retained a high profile throughout his four-year tenure.
It wasn’t enough.
Labour blamed their by-election loss at the time on the low turnout.Higher turnoutThis time the turnout was much higher, with 49,030 of the electorate, or 66.63%, coming out to vote.
It helped Labour to victory, as did an apparent shift in their favour from the SNP vote.
From the moment the first ballot boxes started to arrive at the Glen Pavilion in Dunfermline it was clear it was going to be tight.
Everyone had predicted a two-horse race and that is just how it turned out.
The Lib Dems appeared the more confident of the two parties early on, but as the evening progressed the smiles became thinner and thinner.
Labour were still to claim victory and sweated in a huddle over their figures.
Eventually, the picture became clear and by 1.30am the Lib Dems were all but admitting the game was up.
Mr Rennie arrived at the count shortly afterwards wearing a look of resignation on his face and shortly after 2am his worst fears and those of his supporters were confirmed.
He blamed the Tories for his defeat, telling The Courier, “People were scared of the Conservatives coming to power and they made the simple calculation that the best way to stop that was to vote Labour.
“You could feel it happening.
“It’s the old politics and the old politics of fear. It was a concern we had throughout the campaign.
“I hoped people would see through it but they didn’t.”
As for his time as the area’s MP he said, “It has been the best job I’ve ever had, by far, and I wouldn’t change anything for a minute.”