By Nicholas Bogel-Burroughs

Richard Ross Jr., the Philadelphia police commissioner, abruptly resigned on Tuesday after what the city’s mayor described as a failure to stop harassment and discrimination in the department.

“New allegations of sexual harassment as well as gender and racial discrimination among the rank and file have recently been brought to my attention,” Mayor Jim Kenney said in a statement. “While those allegations do not accuse Commissioner Ross of harassment, I do ultimately believe his resignation is in the best interest of the department.”

Cpl. Audra McCowan, 36, and Officer Jennifer Allen, 38, said in a lawsuit filed last month and amended on Monday that they had been subjected to groping and verbal harassment by their male colleagues — sometimes in front of supervisors — and that they had been punished by their bosses for complaining about the abuse.

A spokeswoman for the mayor, Deana Gamble, said Commissioner Ross had “failed to act adequately” after the complaints by Corporal McCowan and Officer Allen.