A police officer unlawfully discharged a Taser at a naked man who threw a pair of underpants at him during a strip-search, a court has heard.

PC Lee Birch fired the device at the bare chest of Daniel Dove, causing him to collapse and curl up in a ball on the floor of the cell where he was being held, the jury was told.

CCTV footage played to the jury at Bristol crown court showed Birch removing the prongs of the Taser from Dove's chest as he lay prostrate.

Robin Shellard, prosecuting, said use of the Taser did not amount to "reasonable force" as Birch was with two officers, and others were metres away in the custody suite at Melksham police station in Wiltshire.

The prosecutor said Birch fired the Taser without issuing a warning. He said the officer shouted at Dove: "You have assaulted me for the second time."

Birch, 31, denies assault occasioning actual bodily harm and misconduct in a public office.

The jury was told that Dove, 23, was arrested by Birch just before Christmas in 2012 after being ejected from a nightclub in Trowbridge. Dove was later charged with being drunk and disorderly and assaulting Birch and a second officer. The case against him was eventually dropped.

Shellard told the jury that the strip-search at the police station was authorised. Dove complied and took off his clothes apart from his boxer shorts. He then removed his boxers and flicked them at the police officers. They struck Birch on the side of his face.

The prosecutor said Birch used the weapon in a way that was not "necessary, lawful or proportionate".

"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 told the court he had been assaulted by Birch during his arrest and pushed down into a puddle on the street. He claimed Birch had overly tightened his handcuffs, causing him pain in his wrists.

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," 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 or that the officer 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," 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."

The trial continues.