Neil Gaiman, the author and longtime friend of Sir Terry Pratchett, has announced he will be writing the adaptation of their co-authored novel Good Omens for the screen.

Gaiman had previously said he would not adapt their 1990 fantasy novel about the end of the world without Pratchett, who died in March 2015 from a rare form of Alzheimer’s disease. Before Pratchett’s death, director Dirk Maggs – at Gaiman’s instigation – adapted Good Omens for BBC Radio 4, which broadcast in 2014 and included cameos from Pratchett and Gaiman. At the time, Gaiman said he had urged Radio 4 to adapt it because: “I want Terry to be able to enjoy this while he’s still able to.”

But Gaiman, who flew into London on Thursday night for a memorial event for Pratchett at the Barbican, announced to whistles and cheers that he would be personally adapting the book for television. He said he had been spurred to change his mind when he was presented with a letter from Pratchett, intended to be read after his death.

Pratchett’s longtime friend and assistant Rob Wilkins recalled asking Gaiman to adapt Good Omens as they were driving back from Pratchett’s house, on one of the final occasions Gaiman met with him before his death. He said he had approached Gaiman because “it required love, it required patience”.

“Absolutely not,” Gaiman recalled replying, to laughter. “Terry and I had a deal that we would only work on Good Omens things together,” he explained. “Everything that was ever written – bookmarks and tiny little things – we would always collaborate, everything was a collaboration. So, obviously, no.”

Terry Pratchett at home near Salisbury, Wiltshire in 2008. Photograph: Adrian Sherratt/Rex

But Wilkins revealed to the audience that Pratchett had left a letter posthumously for Gaiman. In the letter, Pratchett requested that the author write an adaptation by himself, with his blessing. “At that point, I think I said, ‘You bastard, yes,’” Gaiman recalled, to cheers.

“How much are we allowed to tell them?” Gaiman teased, before he was hushed by Wilkins. “Are we allowed to tell them it is a six-part television series?”

Released in 1990, Good Omens was listed among the BBC’s Big Read of the nation’s 100 favourite books. An apocalyptic black comedy, it tells the tale of Crowley the demon and Aziraphale the angel teaming up to deal with the Antichrist – who is, owing to a muddled baby swap, a schoolboy growing up in modern, rural England.

Multiple attempts to adapt Good Omens have fizzled out in the past: in 2002, the director Terry Gilliam was lined up to helm an adaptation starring Johnny Depp and Robin Williams in the two lead roles. In an interview with Empire in 2013, Gaiman revealed this adaptation had fallen through because Gilliam’s pitch to Hollywood for financing came just months after the 9/11 terrorist attacks. “[Terry] said, ‘Hilarious movie about the Antichrist and the end of the world,’ and they said, ‘Please go away, you’re scaring us.’”

In 2011, Gaiman announced on his website that a TV adaptation was in the works, with the Monty Python comedian Terry Jones and the Emmy-winning screenwriter Gavin Scott set to write the script. In 2012 Pratchett’s daughter, Rhianna, announced the formation of Narrativia, a production company that would hold the exclusive rights to all her father’s works, and said Good Omens would be adapted into a “13-part TV series”. No further plans were announced.

Another adaptation of Pratchett’s work was confirmed at the memorial event on Thursday evening: a feature film of his 1987 novel Mort. The second-highest-grossing screenwriter of all time, Terry Rossio – who has written hits including Shrek, Aladdin and Pirate of the Caribbean: The Curse of the Black Pearl – will be writing the adaptation, while Narrativia will co-produce it. Rhianna Pratchett is also confirmed to be adapting her father’s 2003 novel Wee Free Men into a feature film.

In addition, it was confirmed that the fan-funded film of Pratchett’s short story Troll Bridge is still in the works, as well as a long-rumoured TV show set in Pratchett’s Discworld universe: a fantasy police procedural called The Watch, which has previously had Jones, Scott and Rhianna Pratchett all attached as writers.

• This article was amended on 15 April 2016. An earlier version said Neil Gaiman wrote the BBC Radio 4 adaptation of Good Omens.