A 17-year-old boy with a fixation on the TV serial killer Dexter has been jailed for 25 years for stabbing to death his 17-year-old girlfriend and dismembering her body.

Steven Miles, who was 16 at the time, killed Elizabeth Thomas at his family home in Oxted, Surrey, on 24 January.

After stabbing her in the head and back, he dismembered her legs and arm, wrapped them in clingfilm and put them in bin bags.

The teenage politics student used saws and tools from his father’s tree surgery business to cut up her body, which he covered in a plastic sheet.

Miles, who had been diagnosed as having an autistic syndrome, told his family he had an alter ego called Ed who had instructed him to kill someone. When the defendant’s sister returned home to the flat about an hour after the murder, Miles told her: “Ed made me do something bad.”

Elizabeth Thomas, 17, was described by the trial judge as Miles’s ‘project’. Photograph: Surrey Police/PA

During the sentencing hearing at Guildford crown court, the court heard that Miles had a fascination with horror films and the macabre and had wanted to emulate the actions of Dexter, the lead character of an American TV series about a police forensics officer who is also a serial killer.

The judge, Christopher Critchlow, told Miles: “This is a case of the utmost gravity, the horrific features of which are rarely heard in any court. Nothing this court can say or do, no sentence this court can impose can alleviate the pain suffered by Elizabeth Thomas’s family for a death in such a terrible manner. There must be a life sentence.”

At the start of the hearing, the judge warned the court that the case involved details that were “extremely unpleasant and may cause considerable distress to anyone listening”, and he advised anyone of a nervous disposition to leave.

He said the killing was predetermined and he would have given a whole life term if the defendant had been an adult but, as Miles was a child, he was not allowed to pass that sentence. Critchlow said eminent psychiatrists had agreed that Miles was not schizophrenic and therefore did not have a defence of diminished responsibility.

Miles, wearing a white shirt and black tie, stared straight ahead during the hearing and showed no emotion as the sentence was passed.

The TV show Dexter follows a police detective, played by Michael C Hall, right, who is also a serial killer. Photograph: Showtime/Everett/REX

Speaking of the impact on Elizabeth’s family, Critchlow said: “It’s hard for this court to remain unemotional. Their lives have been changed forever. It’s difficult to find the right words to describe the enormity of what you did to an innocent girl of 17 and a half.

“You decided, at the age of 16, you had to kill somebody, you chose Elizabeth Thomas, who tragically befriended you and who had stood up for you when people described you as different. It’s chilling to read that you described her on occasion as your project.”

Lewis Power QC, defending Miles, described the murder as a “chilling, blood-curdling and sustained” killing inspired by the TV series Dexter. He said: “He had pleaded guilty to a horrendous crime which is beyond belief because of its horrific nature.

“This was a truly gruesome killing ripped from the pages of a hit TV script. The evidence points to the defendant trying to emulate the actions of the character Dexter, who he idolised. The case is a sad testament to the perils of how young people can become entrenched in modern TV blockbusters involving violence which shockingly led to a copycat killing in real life.”

He said the “phenomenon” of Ed was not fully understood by psychiatrists but they agreed that the defendant was not psychotic.