President Rodrigo Duterte of the Philippines said at an event in Tokyo that he had “cured” himself of homosexuality with the help of “beautiful women.”

Mr. Duterte volunteered the remarks on Thursday at a speech to a Filipino crowd.

In the speech, part of which was provided to reporters afterward, he also appeared to try to insult Antonio Trillanes, a senator who is a prominent critic of Mr. Duterte’s antidrug crackdown, by saying the lawmaker is gay.

Mr. Trillanes, in a statement provided by his spokeswoman on Monday, said, “By admitting his gay past, I am beginning to be suspicious of the true nature of Duterte’s seeming obsession towards me.”

“It’s also entirely possible that his strongman projection is just a front,” Mr. Trillanes said. “Whatever, such comments by Duterte show how perverted and sick his mind is.”