MANILA — Women’s rights groups assailed President Rodrigo Duterte of the Philippines on Friday, after he made a crass joke suggesting that rape was inevitable as long as there were beautiful women.

In a rambling speech Thursday night in the central city of Mandaue, Mr. Duterte lashed out at his critics and defended his claims that he had eradicated crime in the city of Davao when he was mayor.

“They said there are many rape cases in Davao,” the president said. “As long as there are many beautiful women, there will be more rape cases.”

Mr. Duterte, who assumed power nationally in 2016, has routinely made headlines around the world for two reasons: a violent crackdown on drug users and dealers which has left thousands of people dead, and a penchant for delivering remarks that many people find offensive, including some about violence against women.