When drug addict Daniel Thomas donned a police uniform and stormed an associate’s home in Melbourne's eastern suburbs in 2016, those inside thought he was the real deal.

"This is a police raid,” he screamed as he entered the Lilydale apartment. “Get on the floor face down. Where are your drugs?" Then, thinking the two men were holding something back, Daniel beat one of them with a hammer until they passed out. "We've killed your mate,” he yelled as the man regained consciousness. “Now tell us where the drugs are."

This incident on July 25, 2016 has now gained Daniel Thomas an 11-and-a-half year prison sentence, after he pleaded guilty to aggravated burglary and a series of other charges, Fairfax reports.

Over the course of the trial, the court heard a series of bizarre and gruelling details from the night, including one moment in which Daniel pulled down the pants of a victim, spread his cheeks, and checked for drugs. Later, after the men had handed over their stash of ice and weed, their attacker beat them with a hammer so badly that when real police officers arrived they thought the two victims were dead. It was only once officers started taking photos of the blood-stained walls and floors that one of the victims moved and police realised they were still alive.

Police later tracked down and confronted Daniel, who pulled a knife and lunged at an officer as they approached him. "You come near me you fucking dog cunt and I'll stab you in the fucking head and kill you," he screamed. Officers shot him with a Taser and doused him with capsicum spray.

At the time of his arrest, Daniel Thomas had been injecting several grams of ice each day as well as using GHB, cannabis, and heroin, according to The Age. He also has an acquired brain injury, possibly from being hit over the head with a cricket bat during a road-rage incident 10 years earlier.

"Even though I regard your prospects as being fairly bleak, I do not regard them as hopeless," said Justice Paul Coghlan, stating that he did not accept Thomas' claim he attacked the two men because one "had supposedly done something to a girlfriend of yours".

"The use of police uniforms, the demand for drugs and money repeated on a number of occasions simply put a lie to that explanation," Justice Coghlan said.

Daniel's victims are both expected to suffer lifelong complications from their injuries, and he must now serve nine years in prison before being eligible for parole. He has not taken drugs during his 1126 days of pre-sentence detention.