The Lib Dems just slashed the Conservative majority in David Cameron's former seat
Tory barrister Robert Courts won the Witney seat by more than 5,000 votes, but his total of 17,313 was less than half the 35,201 votes Cameron managed in the general election last year.
David Cameron resigned first as Prime Minister, then as an MP, after defeat in the EU referendum, when he campaigned to remain in the union.
The Liberal Democrats managed to come second, securing 30.2% of the vote - an increase of 23.5% increase on 2015. Labour, the Green party, and UKIP only managed to poll single figures in terms of vote share.
Here are the full results:
Liberal Democrat leader Tim Farron said the result showed his party were the "comeback kids." The party lost all but eight of its 57 seats in the 2015 general election.
Political pollster Matt Singh said the Lib Dems had "thrown the kitchen sink at the Witney by-election and it worked," but cautioned that the result was not as dramatic as it seemed. He said the ruling party losing 15% of the vote share in a by-election was about par for the course, and that the historical average is about -16%.
A second by-election on Thursday saw a new Labour MP Tracy Brabin elected in the Yorkshire constituency of Batley and Spen. The seat had been vacant since MP Jo Cox was killed by a far-right fanatic in June.