A van driver "intended to kill" a police officer in a "savage" machete attack, a court has heard.
Muhammad Rodwan allegedly stabbed PC Stuart Outten after he was pulled over in Leyton, east London, on 7 August.
PC Outten, 29, suffered multiple stab wounds and skull fractures but managed to use his Taser to disable his attacker, the Old Bailey heard.
Mr Rodwan, 59, admits striking the officer but denies attempted murder, claiming self-defence.
Opening the trial, Jonathan Rees QC said PC Outten suffered six deep wounds to his head, skull fractures, two wounds to his arm and multiple finger fractures, all of which required surgery.
"This case concerns a savage machete attack that was carried out by the defendant on a police constable during what should have been a routine stop of the defendant's white van to investigate whether he was properly insured," he said.
"Despite the ferocity of the attack, and the seriousness of the wounds he had already received, PC Outten somehow managed to discharge his Taser weapon which disabled the defendant and brought the attack to an end.
"The evidence suggests that had he not managed to fire his Taser, his injuries could have been far worse and even fatal."
The prosecutor said the altercation was caught on bodycams worn by PC Outten and his colleague, PC Helen Brooks.
Mr Rees said: "The prosecution alleges that this is a case of attempted murder, in that at the time... the defendant was intending to kill PC Outten.
"For his part, the defendant doesn't dispute that he struck PC Outten with the machete, but he indicated during the interview that followed his arrest that he was acting in self-defence because 'the officer attacked me'."
Mr Rodwan denies attempted murder, an alternative charge of wounding with intent, and possessing a machete on High Road, Leyton.
The trial continues.