Ewan McGregor will star as Danny Torrance in Warner Bros.’ adaptation of the Stephen King novel “Doctor Sleep,” the sequel to horror classic “The Shining.”

Sources say King has given his blessing to McGregor’s casting.

Mike Flanagan, who helmed Netflix’s adaptation of the King novella “Gerald’s Game,” is directing. Flanagan’s producing partner, Trevor Macy, will produce along with Vertigo Entertainment’s Jon Berg.

Warner Bros. had been developing this film, as well as “The Shining” prequel “Overlook Hotel,” for years, but the studio struggled to secure a budget for either film. Following the success of New Line’s “It,” every studio with any sort of King IP under its roof has fast-tracked each property into pre-production.

“Doctor Sleep” begins as Torrance carries the trauma of the Overlook Hotel into adulthood. He’s become a reflection of his murderous father, with lingering rage and a drinking problem that dulls his pain as well as his “shining” powers. Those powers return when he embraces sobriety and uses his gift to help the dying at a hospice. He establishes a psychic connection with a young girl who shares his extreme abilities, and who is being targeted by a group with similar abilities. They’ve found that their powers grow if they inhale the “steam” that comes off others with the power to shine, when they are suffering painful deaths.

Stanley Kubrick directed the original adaptation of “The Shining,” starring Jack Nicholson and Shelley Duvall. Danny Lloyd played a young Danny Torrance. At the time, the film was considered a box office disappointment, earning $44 million on a $19 million budget. Now, however, it is thought to be one of the great horror classics and has a built-in fan base ready for a sequel.

McGregor can next be seen in Disney’s “Winnie the Pooh” adaptation “Christopher Robin.” He is repped by UTA.