Scott Ritter, the former UN weapons inspector who strived to put the brakes on the 2003 invasion of Iraq by loudly disputing claims by Washington and London that Iraq had weapons of mass destruction, was in court in Pennsylvania last night on charges of soliciting sex with a minor over the internet.

 The trial, barring a last-minute plea bargain, was expected to get under way in a Stroudsburg court with jury selection later this week. It stems from his arrest in November 2009 for allegedly soliciting a girl calling herself Emily – and showing acts of masturbation via live streaming video – in an internet chat room. Emily was in fact a male vice officer.

The case is the third in which Mr Ritter has been accused of trying to solicit sex with a minor, in what he claims is a smear campaign against him because of his opposition to the war.

Prosecutors in Pennsylvania alleged that in April 2009, Mr Ritter had an 80-minute, typed conversation with the vice officer identifying himself as 15-year-old Emily. They contend that after turning on his webcam to show himself masturbating, Mr Ritter turned it off again saying he did not want to get into trouble but later turned it on again. Finally the officer, identified as Ryan Venneman in the criminal complaint, revealed his real identity.

"You know ur in a lot of trouble don't u," Mr Venneman typed in the Yahoo chatroom message. "Im a under cover police officer u need to call me asap." Ritter allegedly responded: "Nah. Your not 15. Yahoo is for 18 and over. Its all fantasy. No crime... As far as I know, you're a 56 year old housewife."

Mr Ritter's history of legal tangles stretches back to early 2003 when supposedly sealed police reports of two sex-sting arrests in 2001 were leaked to the press. He hinted at the time that the leaks were part of the campaign to discredit him after he publicly attacked the decision to go to war.

The leaked papers showed Mr Ritter was caught by police in April 2001 and then in June of the same year after contacting and then trying to meet with underage girls in upstate New York where he lives. He received a warning the first time. The second time he was charged with a misdemeanour but a county prosecutor agreed to have the records sealed on condition he stayed out of trouble for six months.

At the time newspapers got hold of those reports, federal prosecutors were seeking to have them unsealed to consider building a case against Mr Ritter, an effort that was later dropped. All this swirled around Mr Ritter, a hero of the anti-war movement, in the weeks before the invasion.

"The timing does stink – I was supposed to be on an airplane yesterday to Baghdad," he told Fox News at the time. "It's a shame that somebody would bring up this old matter, this dismissed matter, and seek to silence me at this time." Mr Ritter, who served in the US Marines in the first Gulf War, had by then spoken to the US Congress and the Iraqi parliament against an invasion.

The defence team in the latest case has asserted Mr Ritter's innocence, and tried to have the case dismissed. His lawyers cited improper conduct by the prosecutor in the case, Michael Rakaczewski, for seeking and eventually obtaining under a court order the same sealed documents pertaining to the 2001 incidents to bolster his case.

Mr Rakaczewksi says the sealed reports are relevant. "The prior bad acts demonstrate the defendant's motive," he said. "The defendant may claim he did not believe the victim was a minor and never intended to expose himself to a minor. However, the fact that he did so twice before would negate this defence. All three involve minors, all three involve females, all three involve communications over the internet, all three involved undercover police and all three involved the defendant's desire to masturbate in the presence of a minor while she watched him."