The SNP stormed to victory in Aberdeen South in a rejection of “Tory austerity and “Boris Johnson’s Brexit”.
Newly-elected SNP MP Stephen Flynn won the race with 20,388 votes – a majority of 3,990 over Scottish Conservative candidate Douglas Lumsden.
Liberal Democrat candidate Ian Yuill came in third with 5,018 while Labour took 3,834 votes.
Speaking in the wake of his victory, Mr Flynn said: “The people of Aberdeen South have spoken and they have rejected Tory austerity and they have rejected Boris Johnson’s Brexit.
“Our pledge over the coming months – and if it comes to it, years – is that I will fight with every ounce of effort I have to protect this city from the Conservatives.”
The SNP MP also revealed he and his wife are due their first baby in two days.
Mr Flynn, who is currently SNP group leader on Aberdeen City Council, said he would consider his position as councillor in the “coming weeks”.
He added: “My priority is sticking up for the people of Aberdeen South and welcoming a baby into the world.”
Aberdeen South was one to watch with party sources claiming throughout the night the SNP and Scottish Conservatives were neck and neck to take the seat.
The seat was previously held by Scottish Conservative Ross Thomson, who was elected with a majority of 4,752 in 2017.
However Mr Thomson, who was the party’s original pick to contest the seat again this time round, stepped down last month following allegations he groped a Labour MP in the Strangers’ Bar of the House of Commons – claims he denies.
He was replaced by Conservative candidate Douglas Lumsden, co-leader of Aberdeen City Council, who said he would have to take time later today to “analyse the results”.
But he added: “Just now I just want to get to my bed, it’s been a tough five weeks.
“It wasn’t an election I was expecting but I’ve enjoyed it.”
Mr Lumsden disputed that voters had grown tired of his party’s central campaign strategy of opposing a second independence referendum.
He added: “Look at the number of people that voted for us, we’re not down by a long way.
“Nationally it looks like the Conservatives will have a good majority and will have a strong government again and it will be able to get Brexit done and we will come back and fight another day.”
Meanwhile, Liberal Democrat candidate Mr Yuill said: “We are very pleased with the result.
“We have increased our vote share in Aberdeen South which is good progress.
“There is still a lot of work to do but we are getting there.”