A Philippine mayor who built a reputation for fighting crime apologized Tuesday for a rape comment that caused a political storm and could dent his chances of winning the presidency in an election just three weeks away.

Rodrigo Duterte, who opinion polls show as the front-runner, issued a statement saying he regretted the remark about an Australian woman who was raped and killed in a prison riot in 1989. The video of his comment, made at a recent rally, appeared on YouTube at the weekend and he had until Tuesday refused to apologize.

His comment sounded like a joke when he spoke of the attractiveness of the rape victim and it caused a public outcry that experts said could cost him votes.