Scottish Labour leader Iain Gray has hung on to his seat by just 151 votes after a huge surge in support for the SNP in the Scottish Parliament election.
Mr Gray held East Lothian with 12,536 votes compared to 12,385 for SNP challenger David Berry, who commanded a 3.1% swing away from Labour.
The close call, which was declared in Haddington after a recount, comes as the SNP claimed the scalps of high-profile former Labour ministers.
Christina McKelvie took Hamilton, Larkhall and Stonehouse with an 18% increase in support, ousting former Labour minister Tom McCabe. The result represents an 11% swing to the SNP.
Linda Fabiani took East Kilbride from Andy Kerr, another former Labour minister, with an 11% increase in voting and a 7% swing for her party. The first seat to declare saw Labour's James Kelly win Rutherglen, but with a 7% swing away from his party.
In 2007, the SNP beat Labour by just one seat to become the largest party at Holyrood, forming a minority administration led by Mr Salmond. The party could not command majority support for key policies, such as an independence referendum, in the last parliament.
The Liberal Democrats have been the biggest losers in the results so far, with their vote appearing to go to the SNP. The Lib Dem candidate in Rutherglen won just 4% of the vote - down 14%. In Hamilton, the Lib Dems secured only 2% of votes cast.
Labour's deputy leader, Harriet Harman, said the SNP's apparent success at the expense of Liberal Democrats raised the prospect of a referendum on Scottish independence.
"Obviously, if the results (in Scotland) are as disappointing as they appear to be, we will have to reflect long and hard on them and learn lessons," Ms Harman told Sky News. "But I hope that the price won't be paid of people being pushed into independence in Scotland when clearly that is not actually what they want."
SNP deputy leader Nicola Sturgeon declared the victories in East Kilbride and Hamilton "outstanding results" and said it was shaping up to be a "historic" night for the SNP.