A police officer accused of unlawfully Tasering a naked man who threw a pair of underpants at him during a strip search denied he had acted out "revenge, anger or retribution".
PC Lee Birch, 30, discharged his weapon into the bare chest of Daniel Dove in a cell at Melksham police station in hours after a disturbance outside a nightclub.
Birch had arrested Mr Dove earlier that morning, on December 23, 2012, outside Moo Moo in Trowbridge, Bristol Crown Court heard.
Mr Dove was charged with being drunk and disorderly and assaulting Birch and a second officer, though the case against him was later dropped.
Birch was then charged with assault occasioning actual bodily harm and misconduct in a public office, which he denies.
Stephen Mooney, representing Birch, asked his client: "This man has been violent, aggressive and abusive and you were one of those affected by it.
"Did you at any stage regard him as someone you wanted to attack out of revenge or anger or any form of retribution?"
Birch replied: "No, absolutely not."
Giving evidence, Birch said he and a colleague were driving around Trowbridge town centre in a patrol car shortly after 2am when they were approached by doormen for help.
The Wiltshire officer said Mr Dove tried to punch him with a "classic haymaker" before repeatedly kneeing PC Read in the groin.
"I ran up behind the male and it was clear he was the aggressor and from behind I put my right arm over his chest and brought him back towards the car to prevent him from assaulting any of the door staff," Birch told the jury.
"He appeared to be drunk.
"I had taken hold of his left arm which was behind his back and I had firm control of him and he said 'I want to go home'.
"I was in the process of telling him that he was not going home and that I was going to arrest him.
"At that point I believe he knew he was going to be arrested.
"I didn't have a very good grasp over him and he tried to break away and go down the street.
"I lost grip of his arm but still had a grip of his collar and he was unable to get away from that.
"With one full movement he swung his body around and threw a classic haymaker punch towards me.
"I saw it at the very last second and managed to move my head to the right and the fist hit me in the ear.
"(If I had not moved) it would have hit my face."
Birch said the threat posed by Mr Dove was "extremely high".
"My initial thought was that he was clearly very angry and if he was prepared to hit a police officer he could hit anybody," he said.
"Mr Dove was now in handcuffs and we picked him up of the floor and PC Read was stood in front of him and as PC Read took hold of one of his arms I saw Mr Dove bring his head up and knee PC Read three times in very quick succession in the groin.
"Pc Read hunched over and was grimacing."
Mr Dove denies assaulting either officer, the court was told.
Birch said that Mr Dove was then placed in a police van and taken to Melksham police station.
During that journey, Mr Dove was arrested and cautioned by Birch on suspicion of being drunk and disorderly and two allegations of assaulting a police officer.
"I do not believe he listened to the caution and he said something like 'You think you're a big man? Wait until these f****** cuffs come off'," Birch said.
Jurors were told that Birch joined Wiltshire Police in 2003 as a civilian control operator before becoming a constable in 2007.
In 2010 he was selected by the force to train to use the Taser electronic stun weapon.
The court heard that when Mr Dove arrived at the police station a strip search was authorised and began in a police cell.
Birch - who had taken the Taser from his holster and placed it behind his back - and two other officers were in attendance.
It is said that Mr Dove took off his boxer shorts and flicked them at the officers, striking Birch to the side of the face.
Birch is then accused of Tasering Mr Dove.
CCTV footage of the incident shows Birch ripping the boxers from Mr Dove and throwing them against the wall of the police cell.
The officer is then heard to shout: "You have assaulted me for the second time."
Mr Dove was left "prostrate on the ground" while Birch removed the prongs of the Taser from his chest.
The prosecution allege the use of the Taser did not amount to "reasonable force", as Birch was accompanied by two officers, with others yards away in the custody suite.
Birch described his demeanour at the police station as "very calm" and said while Mr Dove was being booked in with the custody officer he was "paying close attention to his behaviour".
"It wasn't annoying me. I was just really concerned for my own safety," Birch said.
CCTV was played to the court which showed Birch standing behind Mr Dove holding the bridge of the handcuffs behind his back and Mr Dove wriggling as he speaks to the custody officer.
Asked what Mr Dove is doing, Birch replied: "Again he is deliberately shifting his weight and again he is flicking his feet so I am looking down and constantly watching his body language."
The court then watched CCTV of Mr Dove inside the cell taking off his clothes and Birch removes his Taser and holds it behind his back out of sight.
"I didn't want to display the Taser to Mr Dove, partly because of his prolonged aggression, his use of violence and his failure to follow simple instructions," Birch said.
"Previously I had drawn a Taser in a confined space where I have presented the Taser to a violent individual and they have made an attempt to grab the Taser and remove it from me.
"I was uncomfortable with giving him the option of taking it off me. I didn't think he would react positively if shown the Taser."
Birch said that he did not think using an extendable baton or pava spray was appropriate in the circumstances.
"I didn't believe doing nothing was an option," he said.
Asked to explain why he fired the Taser, Birch said: "Obviously when he pulled his underpants down my colleague, who was wearing gloves, was examining another item, I reluctantly put my hand out to take the item from him because I didn't have gloves on and they were soaking wet.
"It was unexpected... he obviously looked up and whipped me across the face. I am not saying what he did was particularly life-threatening but it was an indication that he was still intent on carrying out assaults.
"This was the third type of assault I had witnessed. I wanted to prevent him carrying out any further assaults.
"I felt he would continue to assault either myself or one of my colleagues if I didn't use that device upon him.
"He was now naked and was soaking wet and I would not wish to restrain a naked man. There was nothing to grab hold off - there's no clothing to grab.
"He was clearly not bothered that he is naked and nothing has stopped him or calmed him down.
"For the safety of myself and the others I drew my Taser."
After the incident Mr Dove became "very withdrawn and very subdued", Birch said.
The trial was adjourned until tomorrow.