Peter Capaldi is to guest star in the opening episode of 'Class'.

Peter Capaldi

Peter Capaldi

The 58-year-old actor is to reprise the role of Doctor Who alongside former 'Coronation Street' actress Katherine Kelly in the new sci-fi spin-off, which is set to broadcast on BBC Three in October.

In the show, written by Patrick Ness, a group of sixth formers are faced with the usual everyday stresses of teenagers - as well as the end of existence.

A show insider told the Daily Mirror newspaper: "What sort of trouble must those kids get themselves in if they need the Doctor to come and bail them out?"

Steven Moffat, the executive producer and lead writer of 'Doctor Who', has previously revealed 'Class' will be like a British version of 'Buffy the Vampire Slayer', promising it would be "dark and sexy and right now".

The third episode of the upcoming series reportedly features a gay sex scene between one of the teenage characters and an older lover.

Filming for the eagerly-awaited show wrapped at the weekend and Patrick has revealed he is keen for TV watchers to see the debut episode.

He recently tweeted: "I put my heart into it. Can't wait for you to see it."

Meanwhile, Steven previously confessed that the part of the iconic Time Lord was offered to a black actor before Peter took on the role.

He said: "Two non-white leads would be amazing. In fact, a lot of people would barely notice. I certainly don't think there's ever been a problem with making the Doctor black, which is why it should happen one day.

"Sometimes the nature of a particular show - historical dramas, for instance - makes diversity more of a challenge, but 'Doctor Who' has absolutely nowhere to hide on this."