The Liberal Democrats experienced a mixed night, with the former leader Nick Clegg losing his seat to Labour but a series of gains elsewhere.
Clegg, the deputy prime minister in the 2010-15 coalition, lost Sheffield Hallam by more than 2,000 votes to the 35-year-old Labour candidate, Jared O’Mara.
Clegg’s successor as party leader, Tim Farron, was luckier, though his former 8,000-plus majority in Westmorland and Lonsdale was cut to 777, necessitating a recount. The former business secretary Vince Cable will return to parliament two years after losing his seat on the Lib Dems’ disastrous 2015 election night.
In other gains, the former coalition junior minister Jo Swinson regained her East Dunbartonshire seat from the SNP. Also in Scotland, the party took Edinburgh West, and Caithness, Sutherland and Easter Ross from the SNP. The Lib Dems also took Bath from the Conservative Ben Howlett.
With the party forecast to get 11 seats in all, two more than in 2015, Cable said the Lib Dems had done well in London and Scotland but acknowledged that it had had some disappointments. Clegg’s defeat was a “big loss”, he said.
Cable said the election had shown the approach to Brexit would need to be rethought, as would the government’s care policies. He told the BBC: “The phrase ‘Brexit means Brexit’ was always a nonsense,” adding that the UK could seek continued membership of the single market and the customs union and that the hard Brexit favoured by Ukip was no longer a viable option.
Earlier, delivering his victory speech, Cable said: “The wider national picture is unclear. All I can say is: I and my party very explicitly committed ourselves not to joining a coalition or a pact. But we will be in constructive opposition.
“I think one of the conclusions which emerges from tonight, from the confusion, is that there is much division in the country, regionally, between generations, and I think we are going to have to learn to talk to each other much more constructively. Issues like personal care and, above all, like Brexit, are going to have to be approached in a consensual, cross-party way.”
Cable said he was “looking forward to being an MP again and concentrating on my constituency work” and thanked his Tory opponent, Tania Mathias, saying she had been “extremely gracious” when she won the seat from him in 2015 and that he would like to reciprocate.
A surge of support for Cable pushed up his vote by more than 11,000 to 34,969, while Mathias polled roughly the same as in 2015.
Cable had held the seat from 1997 up to the last general election, and was made business secretary in the coalition in 2010.
• This article was amended on 9 June 2017 to correct Jared O’Mara’s age.