Plaid Cymru's Lindsay Whittle won the Senedd MP seat with 47.4% of the vote, beating Reform's Llŷr Powell by over 11 percentage points.
UKIP had a poor showing, with a "comically low" number of votes, finishing last in the election.
Someone had to finish last – and UKIP ended up with the wooden spoon.
Despite leading in polls before the election, Reform was denied the win due to a high turnout of 50%.
Author's summary: Plaid Cymru wins Caerphilly by-election with 47.4% of the vote.