Image caption Mr Ritter (right) attended the trial in Pennsylvania on Tuesday with his family

The trial of a former UN weapons inspector who is facing charges of unlawful sexual contact with a minor has opened in Pennsylvania.

Prosecutors said on Tuesday that Scott Ritter, an outspoken critic of the war in Iraq, had a sexually graphic online chat in 2009 with an undercover police officer posing as a 15-year-old girl.

Mr Ritter's lawyer said his client did not think he was speaking with a minor.

If convicted, the 49-year-old could face up to seven years in prison.

Police Detective Ryan Venneman, from Barrett Township in the state of Pennsylvania, testified that Mr Ritter, a former US Marine who served in the 1991 Gulf War, initiated the conversation through a Yahoo chatroom in February 2009.

Mr Ritter then allegedly performed a sex act on himself in front of a web camera, despite the officer's repeated claims that he was a 15-year-old girl named Emily.

Graphic video chat

Mr Venneman told jurors Mr Ritter had supplied his mobile telephone number to him and touched himself while speaking through a video chat.

Prosecutors then played a graphic 20-minute video of the conversation for the jury.

But Mr Ritter's lawyer, Gary Kohlman, said his client believed he was holding a conversation with an adult.

"There will not be a shred of evidence that Mr Ritter in his entire life ever has had an inappropriate conversation with a minor," Mr Kohlman said.

"Ritter at no stage in his chat with Officer Venneman ever once believed that he was doing anything other than speaking and chatting with an adult," he added.

The jury must now decide whether Mr Ritter had believed the person on the other end of the chat was a minor or an adult.

A decade ago, Mr Ritter was charged in New York with trying to set up a meeting with an undercover police officer posing as a 16-year-old girl.

Those charges - which Mr Ritter claimed were politically motivated - were dismissed after he completed six months of probation.