Liberal Democrat leader Jo Swinson has narrowly lost her Dunbartonshire East seat to the SNP by just 149 votes.
Ms Swinson, who started the campaign saying she could become the next prime minister, gained 19,523 votes compared to 19,672 for the SNP's Amy Callaghan.
Speaking at the count, Ms Swinson said for millions of people the election results would bring "dread and dismay".
The Lib Dems are forecast by the BBC to win 11 seats - one less than in the 2017 election.
Prior to the election, the party's ranks had grown to 18 following defections of MPs from other parties, including Chuka Umunna and Sam Gyimah.
They were not re-elected.
The Conservatives have now secured a majority, with Labour suffering heavy losses and the SNP making big gains in Scotland.
On a disappointing night for the Lib Dems, one highlight was the party's candidate in Richmond Park, Sarah Olney, winning the seat from the Conservatives' Zac Goldsmith.
Speaking at the count in Bishopbriggs, outside Glasgow, Ms Swinson said: "These are very significant results for the future of our country and I will be making further remarks later today.
"But let me say now, for millions of people in our country these results will bring dread and dismay and people are looking for hope.
"I still believe we as a country can be warm and generous, inclusive and open and that by working together with our nearest neighbours we can achieve so much more.
"Liberal Democrats will continue to stand up for these values that guide our Liberal movement - openness, fairness, inclusivity. We will stand up for hope."
The SNP's Ms Callaghan told BBC Scotland she was "delighted" to have unseated the Liberal Democrat leader.
The new MP said: "It's quite a momentous achievement, both for me personally but also in terms of the people of East Dunbartonshire, completely rejecting the politics of austerity and also giving the people a chance to choose their own future, I think that is incredibly important."
Ms Swinson became her party's first female leader in a landslide victory over Sir Ed Davey earlier this year, succeeding Sir Vince Cable.
She had served as a minister in the coalition government and was among the party's MPs who paid the price for the tie-up with David Cameron's Tories in the 2015 election - which saw the Lib Dems reduced to a rump of just eight in the Commons.
Ms Swinson fought back when then prime minister Theresa May called another election in 2017, and she regained her Scottish seat from the SNP.
She attracted criticism from some quarters for her policy to revoke Article 50 and cancel Brexit, and for her previous record in the coalition government.
This is the UK's third general election in less than five years - and the first one to take place in December in nearly 100 years - and has been dominated by Britain's 2016 vote to leave the European Union.
The Lib Dems backed Boris Johnson's call in October for an early election, arguing it was the best way of stopping Brexit.
Mr Johnson focused relentlessly on a single message - "get Brexit done" - promising to take the UK out of the EU by 31 January 2020 if he got a majority.
If you cannot see the lookup tool, click here.