The SNP comfortably won the Glenrothes constituency in Fife, beating their nearest rivals Labour by a crushing margin.
Peter Grant will return to Westminster for a third time after securing more than 50% of the overall votes cast, leaving his main rival, Pat Egan, in his wake.
It was a hugely disappointing night for Labour, who polled 9,477 of the votes in a distant second place.
Conservative Amy Thomson received 6,920 votes, while Liberal Democrat Jane Ann Liston polled 2,639.
Independent candidate Victor Farrell, originally standing for the Brexit Party but ditched by them after he posted homophobic messages on social media, polled 1,276 votes.
“This is a clear and resounding message from the electorate that we reject Brexit and a decisive right-wing Tory government in Westminster,” said Mr Grant.
“I look forward to second independence referendum in 2020 where Scotland’s voice will be heard.”
In a catastrophic night for Labour, Pat Egan said it was time for the party to go away and pick up the pieces.
“We have to go and dust ourselves down and pick ourselves up and work out what went wrong here in this election,” he said.
“The message on the doorsteps was positive and the campaign was clean and well-conducted. I congratulate Peter on his result and wish him all the best but we have to see where we go from here.”
In all, 41,616 vote were cast, with 70 spoilt ballot papers from a turnout of 63.29%.