Michael C. Hall as Dexter in hit Showtime show. showtime

Steven Miles, a British teen obsessed with the TV show Dexter, has been given a 25-year jail sentence after he admitted to murdering his 17-year-old girlfriend Elizabeth Thomas.

According to BBC, Miles, who was then 16, told his family that a voice in his head named Ed wanted him to kill someone.

Miles, who had been diagnosed with autistic syndrome, reportedly used saws and tools from his father's "tree surgery business" to cut his girlfriend's body.

According to the Guardian, he wrapped Thomas's dismembered limbs "in clingfilm" (similar to plastic wrap) and then placed them in "bin bags" (garbage bags), as Dexter does in the show.

During the sentencing, the court found that Miles was "fascinated with horror films and the macabre", and how he reportedly "wanted to emulate the actions of Dexter", the serial killer character, played by Michael C Hall, in the Showtime series that was aired from 2006 to 2013.

Judge Christoph 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."

"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."

The defence attorney representing Miles described the murder as "a truly gruesome killing ripped from the pages of a hit TV script," adding: "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."

This is not the first copycat killing which was allegedly inspired by the show. Speaking to the Vancouver Sun, Dexter producer Melissa Rosenberg said she wanted to avoid such incidents, and there was never any intent to "glorify" Dexter's killings, "and we've been very careful not to."

"Every time you think you're identifying with Dexter and rooting for him, for us it's about turning that back on you and saying: 'You may think that he's doing good, but he's a monster," she said. "He's killing because he's a monster.'"