OKLAHOMA CITY (Reuters) - An Oklahoma state judge frequently masturbated and used a device for enhancing erections while his court was in session, charges a petition by the state's attorney general seeking his removal.

Oklahoma Attorney General Drew Edmondson filed the petition on Wednesday with state judicial authorities seeking the ouster of Sapulpa District Judge Donald Thompson, 57, for "conduct constituting an offense involving moral turpitude in violation of the Oklahoma Constitution," Edmondson's spokesman said on Thursday.

The judge flatly denies the charges made in the petition, his lawyer, Clark Brewster, said on Thursday. He said the judge received a penis pump for his 50th birthday as a gag gift, which became a source of a running joke in the courthouse.

"The allegations are bizarre and preposterous," Brewster said. "Recently, some members of local law enforcement that are upset with a number of his rulings, used this situation to embarrass and attack him."

The judge, who was first elected to the bench more than 20 years ago in the state's nonpartisan judicial elections, is based about 80 miles northeast of Oklahoma City.

In the petition, the attorney general charged Thompson used a penis pump, a device billed as providing sexual pleasure and promising better erections and larger penis size, during trials and exposed himself to a court reporter several times while masturbating on the bench.

"On one occasion, Ms. (Lisa) Foster (Thompson's court reporter for 15 years), saw Judge Thompson holding his penis up and shaving underneath it with a disposable razor while on the bench," the petition reads.

Several witnesses, including jurors in Thompson's court and police officers called to testify in trials, said in the petition they heard the "swooshing" sound of a penis pump during trials and saw the judge slumped in his chair, with his elbows on his knees, working the device. The witnesses said the pump sounded like a blood pressure cuff being pumped up.

According to the petition, Thompson admitted he had a penis pump under the bench during a murder trial but he told investigators it was a gag gift from a friend.

The petition also charges Thompson with firing his former court reporter after she cooperated with investigators.