STORY: The defeats, including one in a previously safe seat, could renew speculation about Johnson's future after he earlier this month survived one move by Conservative lawmakers against him.
Johnson has come under intense pressure to resign after he was fined for breaking COVID-19 lockdown rules after a police investigation into gatherings at his Downing Street offices.
The centrist Liberal Democrat party won the seat of Tiverton and Honiton, in a deeply Conservative part of southwest England, with a majority of over 6,000, overturning a majority of more than 24,000 that was won by the Conservatives in 2019.
The Liberal Democrats said it was the biggest ever majority to be overturned at a British parliamentary by-election, suggesting that other Conservative lawmakers may be at risk of losing their seats in the party's southern heartlands.
"Tonight, the people of Tiverton and Honiton have spoken for Britain. They've sent a loud and clear message: It's time for Boris Johnson to go, and go now," the winning Lib Dem candidate Richard Foord said in his victory speech.
"With every day Boris Johnson clings to office, he brings further shame, chaos and neglect."
In the separate parliamentary seat of Wakefield in northern England, the opposition Labour party also defeated the Conservatives.
Johnson led the Conservatives to their biggest majority in three decades at the 2019 national election, winning praise from his party for his ability to win in traditionally Labour-voting areas in north and central England.
However, the loss of Wakefield could indicate that his ability to win again in these areas at the next national election, expected in 2024, has been compromised too.