Deasy was an Emmy award-winning screenwriter whose television credits included Prime Suspect -- The Final Act, Looking After Jo Jo and Father And Son. His cinema credits included The Grass Arena and Captives, and he was working on Gaza, a feature film starring Helen Mirren.

On Sunday, Deasy wrote in a national newspaper of his battle with a primary liver tumour, which was diagnosed in January. He described how surreal it felt to be living under a “death threat” while still feeling fit and well. He wrote: “Little changes at home, I take the kids to school, we celebrate birthdays and argue over whether they’re old enough to walk to school on their own.

“They probably are but the one thing I know for certain is they’re not old enough to be without their dad. “The thought of them losing their father at this point in their lives feels unbearable, too cruel to contemplate, yet each day that passes it comes closer.” Hollywood star Dougray Scott led tributes to Deasy, who was originally from Dublin but moved to Glasgow 12 years ago, where he lived with his wife and three children. The actor described Deasy as “brave, kind, selfless and passionate to the end”.

He said: “Today a great, great man was taken away from us. Very few times in life is one fortunate and blessed enough to meet a person like Frank Deasy. He was quite simply the most extraordinary and brilliant writer I have ever worked with.” In a statement, Anthony Jones, of United Agents, said: “The film and television writer Frank Deasy died suddenly today at the age of 49.

“Among his best-known credits were the mini-series Looking After Jo Jo, Real Men, England Expects, the final mini-series of Prime Suspect, for which he won many awards including an International Emmy, and, last year, The Passion. “He was suffering from liver cancer and, in the past 10 days, his article in The Observer highlighting the lack of organ donors in Great Britain and Ireland generated an enormous response from the public and in particular from the Irish government.”

It was said that Deasy was selected by Mirren to write the finale to the award-winning Prime Suspect series. He was always too modest to comment, but did say in an interview three years ago: “The challenge was to write four hours of television that ends the whole series. “Tennison is an iconic character but I didn’t tread carefully. I took complete licence to go where I wanted … and thankfully Helen loved that and responded to it.” Alison Campsie