A police officer unlawfully Tasered a naked man who threw a pair of underpants at him during a strip search, a court heard.
Pc Lee Birch, 31, discharged his weapon into the bare chest of Daniel Dove in a cell at Melksham Police Station in Wiltshire.
Birch had arrested Mr Dove earlier that morning, on December 23 2012, outside Moo Moo nightclub in Trowbridge, Bristol Crown Court heard.
Dove was charged with being drunk and disorderly and assaulting Pc 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.
Prosecuting, Robin Shellard told a jury Birch had used the "prohibited weapon" in a way that was not "necessary, lawful or proportionate".
"Mr Dove had been taken to a police station in Melksham, where he was placed in a cell and subjected to a strip search," Shellard said.
"During the course of the strip search, when he was naked, a Taser was used against him by Pc Birch. It affected his bodily functions, made him collapse to the ground and curl up in a ball."
The court was told Dove had been ejected from Moo Moo nightclub by doormen, who asked Birch and Pc David Read to attend at 2am.
Dove allegedly punched Birch during his arrest and repeatedly kneed Pc Read in the groin - claims he strenuously denies.
The officers, of Wiltshire Police, then took Dove to Melksham Police Station, where he was booked into the custody suite.
A strip search was authorised and began in a police cell, with Birch - who had taken the Taser from his holster and placed it behind his back - and two other officers attending.
"Mr Dove, then having taken his trousers off, takes his socks off and so it is that Mr Dove is in the cell with three officers, wearing nothing but a pair of boxers," Shellard said.
"Mr Dove kneels down to take his boxers off, therefore being compliant. As he does so, Pc Birch moves forward to take the boxer shorts.
"As he does so, and as Mr Dove rises, Mr Dove flicks the boxer shorts at the police officers. They strike Pc Birch to the side of the face.
"Pc Birch produces the Taser and without any warning at all, he fires the Taser into the chest of the naked Mr Dove."
CCTV footage of the incident shows Birch ripping the boxers from 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."
Dove was left "prostrate on the ground" while Birch removed the prongs of the Taser from his chest.
Shellard said 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.
"You ought to consider very carefully whether or not Mr Dove was acting in such a way that Pc Birch felt necessary to do what he did, and whether Pc Birch was, in fact, acting in lawful self defence," Shellard told the jury.
Dove, who was the first witness in the trial, told the jury he had been assaulted by Birch and Pc Read during his arrest and pushed down into a puddle on the street.
He also insisted Birch had overly tightened his handcuffs, causing him pain in his wrists.
But Dove said he had co-operated fully with bouncers and police officers during his arrest and at the police station until the strip search.
"I was compliant the whole time I was in that cell, I wasn't violent at all," Mr Dove said.
"He [Birch] asked me to get naked, which I did. I did feel I had shown enough so they knew I had nothing on me.
"When he asked me to do it, I did feel quite embarrassed. I took my pants off and flicked them at him, towards his face. I was annoyed at him."
Dove said he received no warning that Birch was armed with a Taser and that he was prepared to use it.
"As soon as I flicked my pants at him, he pulled his arm up from behind his back and shot me with a Taser," Mr Dove said.
"By the time I had seen it, I had no time to react or move. I couldn't hide anywhere, I was in a police station so couldn't run off.
"There was a lot of pain."