If British Prime Minister Boris Johnson fails to win an absolute majority in parliament on Thursday, smaller parties will find themselves holding the trump cards in negotiations to form an alliance.

Here are the parties who could hold the keys to power.

Lib-Dems, voice of Remain pain

Under new leader Jo Swinson, the Liberal Democrats hope to capture the votes of Remainers with a clear message to cancel Brexit, pitching themselves as the pro-European Union party, as opposed to the pro-Brexit Conservatives and undecided Labour.

The Lib Dems, who came second in European elections in May with 22% of the vote, have seen their ranks swell after defections by dissident pro-EU Conservative MPs.

But polls show that they could lose some of their 21 seats after a bruising campaign.

The promise to cancel Brexit without another vote has proven unpopular among even europhiles, who deem it to be undemocratic.

The party's role in a coalition government headed by Conservative David Cameron in the early 2010s, a period marked by severe austerity, has also turned off voters on the left.

Their failure "to capitalise on their distinctive position on Brexit" was "perhaps the biggest surprise of the election campaign," pollster John Curtice, professor at the University of Strathclyde, wrote in the Times.

The DUP, thorn in the Conservatives' side

With no absolute majority in 2017, the Conservatives were forced to join forces with Northern Ireland's Democratic Unionist Party (DUP) to govern.

But the immovable stance of the party's 10 MPs on Brexit was the decisive factor in the failure of Conservative Prime Minister Boris Johnson to get the divorce deal he had reached with the EU through parliament.

The ultra-conservative DUP also opposed an agreement negotiated between Brussels and Mr Johnson's predecessor Theresa May, contributing to her downfall.

They believe Mr Johnson's deal will lead to a border between Northern Ireland and Britain.

SNP, independence fighters fired up by Brexit

The Scottish Nationalist Party (SNP), which wants Scotland to split from the rest of Britain, has capitalised on the 2016 Brexit referendum - in which more than six out of 10 Scots voted to stay in the EU - to breathe life into its campaign.

Led by First Minister Nicola Sturgeon, the party has campaigned under the slogan "Stop Brexit", believing that the vote to leave has exposed a permanent ideological rift between Scotland and the rest of Britain.

The party's progressive ideology means it could theoretically join forces with the Labour Party.

But its demands to hold a second independence referendum in 2020 - after losing the first in 2014 - and its opposition to Britain's Trident nuclear programme could complicate negotiations.

The Brexit Party, devoted eurosceptics

The new Brexit Party is the latest vehicle of chief eurosceptic Nigel Farage.

The former commodities trader has spent his career attacking the European institutions, where he has worked for 20 years.

His party won the European elections in May, weeks after its official launch, leading to Theresa May's departure and a pro-Brexit shift within Tory party.

Despite an intervention by his friend US President Donald Trump, Mr Farage has struggled to compete against fellow Brexit champion Boris Johnson, who warned against splitting the Leave vote.

To prevent that from happening, Mr Farage withdrew Brexit Party candidates in hundreds of seats, while four MEPs quit from his party on Thursday to join the Conservatives.