Mark Gatiss is to be reunited with his Sherlock co-star Una Stubbs when she takes a lead role in his directorial debut, a festive ghost story.
Horror fan Gatiss - who first found fame with dark comedy troupe The League Of Gentlemen - is adapting The Tractate Middoth, a short chiller written by MR James, for BBC2 this Christmas.
He has been a writer on BBC1's Sherlock, in which he also starred as Holmes's brother Mycroft, alongside Stubbs who has played landlady Mrs Hudson.
Gatiss - a regular writer of sci-fi series on Doctor Who - will also be directing a former assistant of the Time Lord in his new half-hour drama, Louise Jameson who played Leela in the mid-1970s opposite fourth Doctor Tom Baker.
Other stars in the cast of The Tractate Middoth include Sacha Dhawan - whose roles have included Last Tango In Halifax and The History Boys - and John Castle, famed for his performance in classic series I, Claudius.
Gatiss, who has also scripted the film, said: "The wonderful adaptations of MR James's tales that I saw on TV as a child have been a lasting inspiration to me.
"I'm delighted to restore the tradition of a BBC Ghost Story for Christmas and bring to life a personal favourite - The Tractate Middoth - one of James's most atmospheric, thrilling, and downright scary tales."
In the tale, terrifying spirits are brought to an academic library as a result of two men going through an ancient Hebrew text.
Mark Bell, the BBC's commissioning editor for arts, said: "In his ghost stories, MR James displays a beguiling mixture of dry wit, singular erudition and a joyful enthusiasm for the macabre.
"Mark Gatiss shares the same attributes and it is tremendously exciting to be working on both a new drama and a documentary investigation of what made this great British eccentric tick."
Gatiss will also host a documentary about the Victorian author which will also be screened during the festive season, with the working title MR James: Ghost Writer.