The SNP returned its two Dundee MPs despite the Tory surge arriving in the east of the city.
Former SNP deputy leader Stewart Hosie won the Dundee East constituency with 18,391 votes.
But Labour’s Lesley Brennan was edged into third place by Conservative candidate Eleanor Price, who received 11,746 votes compared to Ms Brennan’s 11,176.
Mr Hosie said: “I’m absolutely delighted, it’s a huge honour and privilege to be elected again.
“Given the topsy-turvy nature of the polls, we have seen both Dundee MPs returned with significant majorities.”
In 2015, Mr Hosie’s majority was over 19,000 more than the total number of votes he polled on Thursday.
But he said: “2015 was a one-off. To return 56 of 59 MPs was something that any party would find it hard to repeat.”
He added: “I think the key thing is to understand what this result means in terms of the UK.
“Theresa May called this and it looks like she may lose her majority so we will have to see where the cards fall across the UK and with the SNP still likely to be the third largest party.”
Conservative Dundee East candidate Eleanor Price said: “I’m absolutely delighted. I think we’ve got really strong support.
“A lot of people are fed up with the SNP and this result shows the Tory vote is now a viable one.”
Defeated Dundee East Labour candidate Lesley Brennan said she was looking forward to seeing Jeremy Corbyn in 10 Downing Street.