The diehard Dr Who fan wanted to entertain pupils at the end of term

A retiring headmaster has bidden farewell to his school with a hilarious hi-tech Doctor Who video which sees him 'regenerate' into his successor.

Michael Spinney was inspired by his love of the BBC sci-fi show, which he was watched since he was a small boy, to create the unique leaving film.

The prep school teacher also used the clip to reassure pupils and their parents that the next headmaster will provide continuity - just like the different incarnations of The Doctor all represent the same character.

Video courtesy of NeonVisual LTD

Innovative: Headmaster Michael Spinney made a unique Doctor Who video to celebrate his departure

Mr Spinney, 61, enlisted the help of multiple teachers in his secret plan to wow children at the annual speech day for the Beacon School in Amersham, Buckinghamshire, an all-boys private school.

A design and technology teacher spent three months carefully constructing a replica Tardis to feature in the video, which has now been posted to YouTube.

The video begins with Mr Spinney walking in darkness as the title music from the show plays in the background.

He then draws open a pair of curtains to reveal he is dressed as The Doctor before raising his hands and 'magically' turning on the police phone box's lights.

He then steps towards the Tardis, removes his hat and bows to the camera as if saying 'goodbye' - before stepping inside.

Tardis: The clip showed Mr Spinney stepping into a modified police phone box like in the BBC show

Hard work: A teacher at the school spent several months building the replica Tardis for the video

After some footage from the programme showing the phone box travelling through time, The Doctor then warps into new headmaster William Phelps who tells the children: 'I'll see you in September.'

Mr Spinney said: 'I'm an ardent Doctor Who fan and have been since the 1960s when I saw the first episode. I absolutely fell in love with it.

'So when it came to planning my retirement and speech day I wanted a theme of regeneration.

'It's all about new starts for those who are planning to come back in September, and also for me because I was retiring.'

The original plan was to place the Tardis on the stage at the Wycombe Swan Theatre, with Mr Spinney walking in one end and Mr Phelps walking out of the other.

But because the new headmaster was still working in New York, the two men decided to make a video message instead.

Tip of the hat: Mr Spinney used the clip to bid farewell to pupils after 16 years at the school

New face: At the end of the video, Mr Spinney 'regenerates' into new headmaster William Phelps

'It became an affectionate way of saying goodbye to the boys and I'm very pleased to be handing over to the new headmaster,' Mr Spinney said. 'It was a public endorsement.

'I'm told there was a standing ovation and that everybody loved it so much.'

The video was shown to 500 pupils at the £16,000-a-year school, as well as hundreds of parents and teachers.

The Tardis was built by teacher Will Van Tromp, who downloaded the specifications online, and will remain at the school after the headmaster's departure.

Mr Spinney started his teaching career in 1978, and served as the Beacon's headmaster between 1999 and 2009, then again from 2013 until this year.