Channel 4's Derry Girls has beaten BBC's Inside No. 9 in a tense Radio Times vote to find this year's Comedy Champion.
The result went to the wire and the leaders kept changing place. Almost a million votes were cast as those involved encouraged their supporters to vote - in this polls fans were allowed to vote as many times as they wanted.
When the virtual polling booths closed at 10pm Derry Girls had 50.1% of the vote to Inside No 9’s 49.9% – 462,946 votes to 461,140.
Inside No. 9's Reece Shearsmith had pushed hard for the show he makes with Steve Pemberton to win. Afterwards he tweeted “Thank you for all your efforts. It was a kind of collective madness, but now it’s all fine again. Rest your hands”.
Derry Girls writer Lisa McGee tweeted: "Thank you all so much for all your votes . A truly epic battle with the fantastic Inside Number 9 . I’m sure everyone needs a lie down now."
Inside No. 9 is set to return for a live Halloween special this autumn and a fifth series. A second series of Derry Girls, has also been commissioned.
Other shows that were in the running during the 24-hour vote but who didn't make it to the last two included Peter Kay’s Car Share, Mrs Brown’s Boys, Catastrophe and The Young Offenders,