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.
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.”
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.
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.