It was as he was lying on a hospital trolley, after surgery to treat testicular cancer in 2018, that Graham Linehan picked up his phone and first definitively waded into the issue of trans rights.

According to his memoir, Tough Crowd: How I Made and Lost a Career in Comedy, and subsequent media interviews, the Irish-born comedian could not remember quite what he wrote in those groggy early tweets but it nailed “my colours to the gender-critical mast”.

He did recall the response of one of his readers: “I wish the cancer had won”.

“My ordeal had begun,” Linehan wrote. “Cast adrift, I was about to lose everything – my career, my marriage, my reputation.”

The explanation as to how Linehan went from a nasty Twitter (now X) spat seven years ago to career and personal armageddon lies in a peculiar metamorphosis.

Linehan used to be known as a superlative comedy writer. Today, the creator of Black Books, The IT Crowd and – most popular of all – Father Ted, describes himself as a writer “about the current all-out assault on woman’s rights”.

His goals are put in almost biblical terms: “To reveal the havoc gender identity had wrought on society, expose those who had enabled it and help bring about its end.”

To his supporters, Linehan is a brave warrior, whose relentless campaigning – online and off – is characterised by some as being ahead of his time, after April’s supreme court judgment that the terms “woman” and “sex” in the Equality Act refer only to a biological woman and to biological sex.

Others see monomania and, at times, cruelty. He has sent hundreds of tweets a day at times, often in the early hours. In 2021, Linehan set up a fake account on a dating account designed to “connect womxn and queer people”, in order to publicly expose people over their use of pronouns.

Graham Linehan’s 16-year marriage to Helen Serafinowicz ended in 2020, a split he blamed on the pressures of campaigning. Photograph: Teri Pengilley/The Guardian

He was dropped in 2023 by his agent after describing the actor David Tennant as an “abusive groomer”, after the Doctor Who star wore a T-shirt emblazoned with the words: “Leave trans kids alone you absolute freaks”.

That this activity has had a huge impact on his career is undoubted.

After the achievements of the IT Crowd, for which he won an Emmy, he struggled to find similar levels of success, but it was his extracurricular activities that prompted the cancellation of a planned stage musical of Father Ted, the charming sitcom that gently poked fun at the priesthood.

Linehan had refused requests from its producers to stop his campaigning on trans issues or accept £200,000 for removing his name from the musical project.

His 16-year marriage to the comedy writer Helen Serafinowicz ended in 2020. Linehan put the blame on the pressures that came with his campaigning. “I did it for my wife and daughter, even though we broke up,” he said. “I did it for them and I’d do it again.”

Writing on his Substack account about his recent arrest over tweets suspected of inciting violence, Linehan said that he had laughed at first when he saw five armed officers. “I couldn’t help myself,” he wrote. “‘Don’t tell me! You’ve been sent by trans activists.” He also shared an audio file of the encounter.

According to the audio, an officer explained that his name had been put on the Police National Computer after allegations about his Twitter activity. He had been flagged as wanted when landing at Heathrow and they were there to arrest him and take to him a police station for questioning.

“Holy shit, I cannot fucking believe it,” he shouted. “You know what this country looks like from America? I am going to sue you into the ground, I am going to sue you into the ground. Fucking bastards, how dare you. I won’t fucking calm down.”