It was a grim night for the Liberal Democrats as leader Jo Swinson lost her seat to the SNP.
Ms Swinson lost her East Dunbartonshire constituency by 149 votes to Amy Callaghan.
Nationally the Lib Dems finished with 11 seats, down one from 2017.
Ms Swinson steps down as leader just five months after being elected.
Lib Dem party rules state the leader must have a seat in the Commons.
Sir Ed Davey and Baroness Sal Brinton will be acting leaders for the party and a leadership contest will be held in the new year.
SNP leader Nicola Sturgeon was filmed celebrating as she learned her party had beaten Ms Swinson.
She grinned and cheered silently pumping her arms as she watched TV coverage of the declaration.
Brexit Party leader Nigel Farage described her response as “graceless and nasty” on Twitter.
Ms Swinson, who started the campaign saying she could be the next prime minister, said the election results would bring ‘dread and dismay’ to millions around the country.
She said: “I still believe that we, as a country, can be warm and generous, inclusive and open.”
The Lib Dems had pinned their campaign on axing Brexit but the strong remain message failed to resonate with voters.
Her policy of revoking Article 50 may have cost her the support of those in favour of a people’s vote.
The Lib Dems have had to fight to regain support following its performance in the coalition.
She has repeatedly apologised for her role in austerity measures during this period.
This is the second time Ms Swinson has lost her seat.
She took the constituency from Labour in 2005 and held onto it five years later.
She was defeated in 2015 when the SNP surged in popularity, but won back her seat in 2017 when support for Ms Sturgeon’s party fell.
It was a disappointing night for the party but Sarah Olney in Richmond Park offered some relief.
She won the seat from the Conservatives’ Zac Goldsmith and it was the party’s first gain on election night.
Liberal Democrats president Sal Brinton said: “I want to thank Jo Swinson for her honest and fearless leadership of the Liberal Democrats.
“In this election, we gained more votes than in 2017 and we have been joined by many new MPs.
“In the weeks ahead we will elect a new leader and our party will continue to be the rallying point for anyone who believes in a country where everyone has the chance to get on in life.”
Ms Swinson said: “Some will be celebrating the wave of nationalism that is sweeping on both sides of the border. And I do congratulate all those who are newly elected.
“These are very significant results for the future of our country and I will be making further remarks later.”