SNP Westminster leader Stephen Flynn has won in Aberdeen South after a bruising set of results for his party across Scotland.
The re-elected MP clinched victory by winning 15,213 votes compared with 11,455 for his next placed Labour candidate Tauqeer Malik.
Labour had been buoyed by positive polling for the party which suggested they could challenge the senior SNP figure in the seat.
In his victory speech, Mr Flynn made clear that the SNP is experiencing a painful backlash.
“We are experiencing something we have not experienced for quite some time,” he said from the stage in Aberdeen.
“We are going to be beaten in Scotland and we are going to be beaten well.
“Now is the time that we must listen and learn. We must listen to what the people of Scotland have told us.”
Turnout for the seat was 60.17% with 46, 527 votes cast across the constituency.
Speaking to the P&J after the result at P&J Live in Aberdeen, Mr Flynn said the party was getting “thumped” across the country.
Expressing sympathy for former colleagues who have lost their jobs, he added: “But the party has obviously failed to deliver the message that the people wanted.
“And as such we need to be urgent in our reflections. We need to determine what’s gone wrong and make sure we have a path to do better. The public are never wrong.
“They’ve made their judgment and they’ve decided not to put their faith in the SNP to the extent that they have done in recent years.
“It would be foolish of any political party not to take that shock seriously.”
Victory for Stephen Flynn
Mr Flynn had a high profile role in the SNP’s general election campaign, garnering praise for his performance during television debates.
He repeatedly hit out at the Labour Party for its North Sea policy, repeating warnings from experts that it risked tens of thousands of jobs.
Mr Malik, who came in second, said he felt the party had done an “amazing job”.
“It was close but what happened is the Tory vote held up and that’s the main reason that cost us”, he said.
“Stephen Flynn can not celebrate because the people of Scotland decided they’re not interested in independence anymore.”
He added: “It is a fantastic night for Labour overall across the UK and Keir Starmer will be the new prime minister of the UK.”
“The message is clear: it’s time for change and it’s time for Labour.”
Ring doorbell controversy
His campaign drew controversy last week after leaked ring doorbell footage revealed him telling a voter his party wanted the Tories to win the seat in 2019.
The “damning” footage obtained by the P&J showed the Labour candidate telling a voter that the party “did not bother at all” in 2019 so the Tories would win.
Labour trailed in fourth that year, behind the Conservatives and Liberal Democrats.
The constituency takes in some of the country’s most affluent areas, including Bieldside, Cults, Ferryhill and the city’s West End, but also includes more traditionally working-class areas such as Torry and Kincorth.
This year, the boundaries have changed slightly and new voters from the centre of Aberdeen are now included, adding more uncertainty.
It is seen as one of the most volatile in the north-east with shifting party allegiances.
Labour held the seat from 1997 to 2015, before the SNP won it in the 2015 race.
But the nationalists lost it just two years later in 2017, when it turned Conservative before Mr Flynn won it back for the party two years later.
Voting breakdown:
Stephen Flynn (SNP) 15,213
John Wheeler (Con) 11,300
Tauqeer Malik (Lab) 11,455
Guy Ingerson (Green) 1,609
Jeff Goodhall (Lib) 2,921
Graeme Craib (Scottish Family Party) 423
Sophie Molly (Independent) 225
Michael Pearce (Reform) 3,199
Read more as election results come in across the north and north-east:
Conversation