In the Conservatives' first electoral test since Johnson became prime minister nine days ago, the party was defeated for the seat of Brecon and Radnorshire in Wales by Jane Dodds of the opposition Liberal Democrats. Dodds won 43% of the vote, while Conservative Chris Davies, who was fighting to retain the seat after being convicted and fined for expenses fraud, got 39%.
The result makes it harder for Johnson's government to pass laws and win votes in Parliament, with Brexit scheduled to happen in less than three months.
Johnson says Britain will leave the European Union on Oct. 31, with or without a divorce deal. But Parliament voted in the past against the country leaving the EU without an agreement on the terms, and is likely to try again in the fall to thwart Johnson's plans.
In her victory speech, Dodds urged the prime minister to "stop playing with the future of our communities and rule out a no-deal Brexit now.'"
The result reflects the seismic effect the U.K.'s decision three years ago to leave the 28-nation EU has had on the country's politics, with voters increasingly split into pro-Brexit and pro-EU camps. The pro-EU Liberal Democrats have seen their support surge because of their call for the U.K. to remain in the bloc.
For the Brecon by-election, the Lib Dems made a pact with two other pro-EU parties, which did not run to give Dodds a better chance. The country's main opposition Labour Party, whose leadership is divided over Brexit, saw voters desert it and won just 5% of the votes.
The Conservatives, meanwhile, lost some support to the Brexit Party led by longtime euroskeptic figurehead Nigel Farage, which took 10% of the votes.
The Conservatives lack an overall majority in the House of Commons, and rely on an alliance with 10 lawmakers from Northern Ireland's Democratic Unionist Party. The loss of the Brecon seat leaves the governing alliance with 320 of the 639 voting lawmakers — the bare minimum needed to carry votes.
Johnson became prime minister last week after winning a Conservative leadership race by vowing to take Britain out of the EU on Oct. 31, with or without a divorce deal.
His hard-line stance is both risky and divisive. Johnson says he wants a Brexit deal, but is demanding the EU make major changes to the divorce agreement it struck with May, which was rejected three times by Britain's Parliament. The EU is adamant that it won't renegotiate.
Most economists say leaving the EU without a deal would severely disrupt trade and plunge the U.K. into recession. Bank of England Gov. Mark Carney said Thursday that a no-deal Brexit would deliver an "instantaneous shock" to the economy in which the pound would fall, inflation would rise and GDP would slow.
Follow AP's full coverage of Brexit at: https://www.apnews.com/Brexit