Tony Buttigieg, 36, of Caerleon in Newport, was Tasered by officers from Gwent Police as they struggled to subdue him in the hallway of a block of flats in the town in October 2017.
The incident caught on a “harrowing” body cam video.
Officers responding to a report of a man banging doors in the flats found Buttigieg, who appeared to be under the influence of drugs or alcohol, on a landing holding two large blades.
While a colleague held the door to the landing area closed, Pc Rhydian Jones tried unsuccessfully to persuade him to drop the weapons.
Buttigieg refused and instead held the knife-points to his stomach as if to harm himself, while verbally threatening to harm the officers.
Pc Jones, having failed to calm Buttigieg, opened the door but Buttigieg leapt out brandishing the weapons.
The officer quickly pushed it shut, trapping him between the door and the frame.
As Buttigieg struggled to get free, another officer Tasered him.
The weapon did not incapacitate Buttigieg, who began to “lash out”.
He tried to stab Pc Jones on “at least three occasions”, according to a statement from the force, before Pc Jones and Pc Ashley Cotton wrestled him to the ground, disarmed and subdued him.
In the statement, Gwent Police said: “Tony Buttigieg clearly appeared to be under the influence of either alcohol or some other intoxicating substance and was waving the knives around, making threats to harm himself and the officers.
“Despite officers’ negotiations, he tried to gain entry to another flat and then began to push the knife into his stomach area in a self-harm action.”
Buttigieg, who was originally charged with attempted murder, accepted a charge of attempted grievous bodily harm at a hearing in February.
Police released details of the case as they honoured the officers who attended the incident.
Detective Chief Inspector Nick Wilkie, who led the investigation, said: “The body worn video footage is particularly harrowing to watch.
More from UK
Youngsters are ‘not being heard’ over violent crime
Man critical after 13 injured in a two-bus crash in Luton
Family of Hither Green ‘burglar’ Henry Vincent plead with neighbours not to tear down tributes
Theresa May and other politicians not invited to Royal wedding
Who’s been invited to the Royal wedding?
Wednesday’s national newspaper front pages
“Luckily, the outcome wasn’t fatal but nonetheless it was traumatic for all those involved,” he added.
Pc Jones, Pc Gareth Marsh and Pc Ashley Cotton received a Chief Constable’s Commendation for their bravery in responding to the incident.