In pictures: How the Caerphilly by-election unfolded

The by-election in Caerphilly was called following the sudden death of the former Member of the Senedd Hefin David in August
- Published
It was a historic night in Caerphilly as Plaid Cymru won the seat from Labour, which saw the party suffer its first defeat in the area for a century.
Lindsay Whittle - a councillor with almost 50 years of experience under his belt - was elected as the new Member of the Senedd, with Reform's Llyr Powell finishing second and Labour third.
The result saw a swing of 27% from Labour, which has held the seat in Westminster since the 1920s and in the Senedd since it began at the turn of the 21st Century.
Here's how the night panned out - in pictures.

The polls closed at 22:00 BST, with counting beginning shortly after at Caerphilly Leisure Centre

There was a tense feeling in the room from the beginning, with polls suggesting it would be a two-horse race between Plaid Cymru's Lindsay Whittle and Llyr Powell from Reform UK

Two words kept cropping up throughout the night: "Very close". This was evident on the face of Reform's Llyr Powell

Richard Tunnicliffe's 3,713 votes saw Labour drop to third amid a 27% swing away from the party in one of its strongholds

But it soon became apparent that Plaid had edged ahead, with party members appearing in a positive mood

Party leader Rhun ap Iorwerth arrived on the scene smiling shortly after 01:00, suggesting the party had won

The result was announced just after 02:00, with Whittle gaining 47.38% of the vote, beating Reform into second place and Labour lagging behind in third

Whittle becomes the new Member of the Senedd for Caerphilly and will hold the role for six months until the Welsh Parliament election in May