The SNP has made big gains across Scotland, with Nicola Sturgeon saying the country had sent a “clear message” on a second independence referendum.
With all of the Scottish results in, the SNP has won 47 of the country’s 59 seats – 12 more than the 35 it won in 2017.
The party also defeated Liberal Democrat leader Jo Swinson in East Dunbartonshire.
Ms Sturgeon said the result had exceeded her expectations.
The SNP secured 45% of the votes – 8.1% more than in the last general election in 2017.
The Conservatives have won six seats, the Liberal Democrats four and Labour one.
Ms Sturgeon, the SNP leader and Scottish First Minister, said it had been an “exceptionally good night” for her party – though she described the picture across the UK as “pretty grim”.
She said the Tories north of the border had had a “catastrophic result”.
The Tory campaign in Scotland had focused squarely on preventing a second vote on independence – while the SNP had based their campaign on stopping Brexit and pursuing a fresh independence referendum.
Speaking from the count in Glasgow, where the SNP won all the seats up for grabs, Ms Sturgeon told BBC Scotland: “I accept that Boris Johnson after this election has a mandate to take England out of the Euroepan Union, but he does not have a mandate to take Scotland out of the European Union.
“And I have a mandate, a renewed, refreshed, strengthened mandate to offer people in Scotland the choice of a different future.
“It is then up to people in Scotland what choice they make.
“I don’t pretend everybody who voted SNP yesterday will necessarily support independence, but there is a clear endorsement Scotland should get to decide our future and not have it decided for us.”
The Conservatives and Prime Minister Boris Johnson have won an overall majority across the UK after taking a string of former Labour strongholds in England and Wales.
Leader Jeremy Corbyn said it was a “very disappointing night for the Labour Party” and confirmed he would not lead the party into the next election.
Mr Corbyn, who had sought to exploit Mr Trump’s support for the PM during the election campaign, admitted it had been a “very disappointing” night.
He announced he would call it a day as leader as he was re-elected in his London seat.
He said he would discuss with the party how to ensure there was a “process of reflection.”
“I will lead the party during this period to ensure this discussion takes place.”
The mood at Mr Johnson’s count was much more upbeat as he declared: “It does look as though this One Nation Conservative government has been given a powerful new mandate to get Brexit done.”
He added: “Above all I want to thank the people of this country for turning out to vote in a December election that we didn’t want to call but which I think has turned out to be a historic election that gives us now, in this new government, the chance to respect the democratic will of the British people to change this country for the better and to unleash the potential of the entire people of this country.
“And that is what we will now do, and if we are lucky enough to be returned, as the exit polls seem to suggest, then that work will begin tomorrow… or as I should say, not tomorrow, today!”
Mr Corbyn’s party, which had 243 MPs when Parliament was dissolved last month, was heading for its worst result since 1935 after support crumbled in its so-called ‘red wall’ of formerly safe seats across the north, the Midlands and Wales.