Hawaii Five-0 showrunner Peter M. Lenkov has revealed the ending that was originally planned for series.

The CBS crime drama recently aired its series finale following its cancellation, but the ending fans were originally meant to see actually ended up being used in 2016 for the season 7 premiere.

The scene that has everyone talking had the injured Steve McGarrett in the hospital's chapel, where he was joined by a stranger who happened to be a former Hawaii cop.

That retired law enforcer was played by none other than a CGI recreation of the late actor Jack Lord, who portrayed the original McGarrett from the classic Hawaii Five-0 series.

Silver Screen Collection Getty Images

Now, Lenkov has explained how he originally intended to use the scene for the series finale, but when he realised the show wouldn't be ending anytime soon after season 6, he wanted to be one of the first to show off the CGI technology.

"I actually wrote the scene very differently,” he told TVLine. "The end of the show was McGarrett sitting on a bench, and this older man sits down next to him.

"McGarrett talks about his life and his focus and his commitment to the task force, and how it made him sort of sacrifice everything else, and the Jack Lord character says very much what was in that Season 7 episode — which is, what you’re doing is your legacy."

Steve McGarrett (Jack Lord) in the original Hawaii Five-O Bettmann Getty Images

He added that the scene "was going to end with McGarrett looking back over, and the guy is gone. The phone rings, and he says, 'McGarrett…. I’ll be right there.'

"So you know that even though he was considering maybe hanging it up, that conversation allowed him to realise that this is who he is. The audience would know that the task force would continue under his leadership."

Hawaii Five-0 airs on CBS.

Digital Spy now has a newsletter – sign up to get it sent straight to your inbox.

Looking for more TV recommendations and discussion? Head over to our Facebook Group to see new picks every day, and chat with other readers about what they’re watching right now.

This content is created and maintained by a third party, and imported onto this page to help users provide their email addresses. You may be able to find more information about this and similar content at piano.io