SAO PAULO (AP) - The decision by a Brazilian judge to free a man who was arrested after allegedly ejaculating on a woman on a public bus is causing anger in a country where gender violence is prevalent.

The incident occurred Tuesday as the bus was going down Avenida Paulista, one of the busiest avenues in Sao Paulo. Passengers grabbed the perpetrator and turned him over to police.

But less than 24 hours later, judge Jose Eugenio do Amaral Souza Neto ruled the man had committed a misdemeanor, not a rape, and ordered his release.

The incident did not involve "constraints, violence or threats," Souza Neto said in justifying his decision. "The victim was seated when she was surprised by the ejaculation."

According to the UOL news portal, police records show that Diego Ferreira de Novaes has been detained 16 times since 2009 for committing similar crimes, including five times just this year.

Retired prosecutor Luiza Nagib Eluf told reporters the judge's decision "makes a mockery" of justice.

She said the ruling was unacceptable because it ignored the fact that Brazil's penal code defines rape as a heinous crime.

The Sao Paulo Association of Judges said in a statement Friday that the criticisms were cowardly attacks against the judge for accepting the recommendation of prosecutors to release de Novaes.

The Sao Paulo-based Right to Defense Institute also came to the judge's defense saying in a statement: "The judiciary cannot be held hostage to a punitive wave that casts doubt on judges whenever they rule in the defendant's favor."