Newly elected British Prime Minister Boris Johnson suffered a setback after his Conservative Party lost a special election on Friday, reducing his parliamentary majority to just one lawmaker.

The election was seen as a test for Johnson whether his appeal and hardline Brexit stance would translate to victory for the incumbent Conservative Member of Parliament.

But the party was defeated for the seat of Brecon and Radnorshire in Wales by Jane Dodds of the opposition Liberal Democrats.

BORIS JOHNSON'S GOVERNMENT SETS ASIDE ADDITIONAL $2.8B TO DEAL WITH POTENTIAL NO-DEAL BREXIT FALLOUT

Liberal Democrats' Jane Dodds, centre, celebrates with supporters as she wins the seat in the Brecon and Radnorshire by-election at the Royal Welsh Showground in Llanelwedd, Builth Wells, Wales Friday, Aug. 2, 2019. After a first week in office that saw him booed in Scotland and berated in Belfast, British Prime Minister Boris Johnson was facing his first electoral test on Thursday, a special election that could see his Conservative government's working majority in Parliament cut to just one vote. (Ben Birchall/PA via AP)

Dodds won 43 percent of the vote, while Conservative Chris Davies, who had to defend the seat after he was convicted and fined for expenses fraud, received 39 percent of the vote.

The loss of a Conservative MP is particularly troubling for the Johnson government as ultimately it will be parliament that will ratify the supposed new Brexit agreement before the Oct. 31 deadline.

The lack of a significant majority also makes the current government vulnerable to an opposition no-confidence vote that could trigger an early general election. Johnson has ruled out an election before the country leaves the European Union.

The Liberal Democrats candidate, just like the rest of the party, strongly opposes Brexit and calls for a second referendum. She urged Johnson in her victory speech to “stop playing with the future of our communities and rule out a no-deal Brexit now.”

NEWT GINGRICH: BORIS JOHNSON HAS ALREADY MADE A HUGE IMPRINT ON BRITISH GOVERNMENT AND POLITICS

Johnson has promised and recently reiterated his seriousness of leaving the EU by the Oct. 31 deadline, with or without a deal.

The parliament previously rejected the plan to leave the bloc without the deal, it also opposed former Theresa May’s withdrawal deal, with Tory rebels saying the deal was flawed and didn’t address concerns regarding the sensitive issue of the Irish border.

The E.U., meanwhile, said this week that the negotiations won’t be reopened, even as Johnson promises he will get Britain a better deal.

The British government has set aside an additional $2.8 billion (£2.1 billion) in preparation for a no-deal Brexit.

The additional funds double the amount the government has set aside this year, signaling the government’s seriousness to leave the bloc by the October deadline.

CLICK HERE TO GET THE FOX NEWS APP

The extra money is planned to be used on more border force officers and upgrades to transport infrastructure at ports in the event of so-called hard Brexit. The money will also be used to help ease easing traffic congestion in Kent and tackle queues created by delays at the border.

The government will also tap into the fund to stockpile medicines to ensure continued supply and a national policy to help businesses.

The Associated Press contributed to this report.