The SNP’s Tommy Sheppard had been re-elected in the Edinburgh East seat.
Mr Sheppard took the seat with a majority of 3425, taking 18,509 votes.
Labour’s Patsy King came in second with 15,084, while Conservative Katie Mackie came in third with 8081.
Meanwhile Lib Dem Tristan Gray took 1849 votes.
Mr Sheppard said: “The overwhelming story tonight is that the Conservative party are snatching defeat from the jaws of victory.”
He hit out at “Ruth Davidson’s obsession with trying to stop Scotland having a choice about our future”.
Mr Sheppard said the Labour party had done “remarkably well” in the election.
“People are putting faith in the Labour party because they like what Jeremy Corbyn stands for – but I hope they know they are sending MPS to Westminster with a ticket to oppose Jeremy Corbyn.”
And he promised: “No matter what happens I promise you that we will look again at Brexit - we are determined not to be dragged out from a partnership with our European neighbours against the will of the people of Scotland.”
Mr Sheppard said: “There is one clear victor in Scotland – one party on course to win more seats than all the other parties put together - and that is the SNP.
“The story of tonight is that the SNP has won and the Conservative Party has lost.”