A police officer shot and wounded a man who was in court on a harassment charge Thursday after he attacked a judge and tried to grab a gun from a spectator, police said.

Some people who were in the courtroom disputed that account, saying they did not see the man hit or threaten the judge or attempt to grab a weapon.