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

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

The DUP is the main party in Northern Ireland and is led by 49-year-old Arlene Foster
The DUP is the main party in Northern Ireland and is led by 49-year-old Arlene Foster AFP / PAUL FAITH

Under new 39-year-old 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 percent of the vote, have seen their ranks swell after defections by dissident pro-EU Conservative MPs.

Led by energetic First Minister Nicola Sturgeon, 49, the Scottish Nationalist Party has campaigned under the slogan "Stop Brexit"
Led by energetic First Minister Nicola Sturgeon, 49, the Scottish Nationalist Party has campaigned under the slogan "Stop Brexit" AFP / ANDY BUCHANAN

But polls suggest 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 see it as 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.

The Brexit Party is led by chief eurosceptic Nigel Farage
The Brexit Party is led by chief eurosceptic Nigel Farage AFP / Paul ELLIS

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.

Will British Prime Minister Boris Johnson be able to secure an absolute majority in the election on Thursday?
Will British Prime Minister Boris Johnson be able to secure an absolute majority in the election on Thursday? POOL / TOBY MELVILLE

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

But the immovable stance of the ultra-conservative 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 party also opposed an agreement negotiated between Brussels and Johnson's predecessor Theresa May, contributing to her downfall.

The Liberal Democrats hope to capture the votes of "Remainers" with a clear message to cancel Brexit
The Liberal Democrats hope to capture the votes of "Remainers" with a clear message to cancel Brexit AFP / ANDY BUCHANAN

They believe Johnson's deal will lead to a border between Northern Ireland and mainland Britain, which they fear could stoke growing momentum for a united Ireland.

The DUP is the main party in Northern Ireland and is led by 49-year-old Arlene Foster, whose father, a policeman, was shot and wounded by Irish Republican Army (IRA) paramilitaries during the so-called Troubles.

The Scottish National 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 energetic First Minister Nicola Sturgeon, 49, the party has campaigned under the slogan "Stop Brexit", believing 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 new party is the latest vehicle of chief eurosceptic Nigel Farage.

The 55-year-old 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 Donald Trump, Farage has struggled to compete against fellow Brexit champion Boris Johnson, who warned against splitting the Leave vote.

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