The The Shining movie, but its ending pays tribute to the end of Stephen King's book. Adapting a King novel into a feature film is certainly far from uncharted territory at this point, but director and writer Mike Flanagan faced a very unique task when making Doctor Sleep. Flanagan was nominally set to adapt King's Doctor Sleep book, but due to the iconic nature of Kubrick's Shining, Warner Bros. didn't want that film's events ignored.

This led to a sort of hybrid, adapting scenes and subplots from the Doctor Sleep book, but still deferring to what happened in Kubrick's Shining movie where necessary. This includes making Dick Hallorann into Danny Torrance's spirit guide from the start, even though Dick only died in the movie and not the Shining book. Another major change is that Kubrick left the Overlook Hotel standing, while King destroyed it, leading to a final act that heavily involves the malevolent building.

Related: Every Stephen King Book Character With Psychic Powers

Looking at more specific parts of Doctor Sleep though, the conclusion of the film saw fit to not only change things up from the book it was adapting, but pay a clever homage to King's Shining along the way. While Doctor Sleep's box office was a letdown, that certainly wasn't due to a lack of reverence expressed for the original classic.

How Doctor Sleep's Ending Honors Stephen King's The Shining

Doctor Sleep Dan Torrance Overlook Hotel

In the ending of Mike Flanagan's Doctor Sleep movie, Danny Torrance and Abra Stone lure Rose the Hat to the Overlook Hotel, where Danny wakes up its various ghosts and they essentially devour Rose's "steam," a thing those who Shine possess, killing her. The hotel then possesses Danny, who targets Abra, until it's revealed that Danny had earlier set the Overlook's unstable boiler on high, eventually leading to both Danny and the place that had ruined his life going up in flames. That's almost entirely different from the ending of King's Doctor Sleep book, which sees Danny, Abra, and Rose fighting at the spot the hotel once stood, and winning with the help of Jack Torrance's remorseful ghost. Danny also survives.

That said, while Doctor Sleep's movie ending doesn't much resemble its source material, it does highly resemble the ending of King's Shining book, which concluded with a possessed Jack reminded by Danny that he had forgotten to relieve the pressure on the boiler, leading to he and the Overlook being destroyed. After seeing Doctor Sleep, King said that he felt the sequel had helped redeem Kubrick's Shining a bit in his mind, an adaptation he infamously hated, feeling it lost the essence and intent of his novel. Flanagan choosing to end things in a massive tribute to what Kubrick had excised from the book likely helped facilitate the turnaround in King's opinion.

More: How Doctor Sleep Recreated The Shining's Overlook Hotel