Philippine President Rodrigo Duterte said he used to be gay but "cured" himself by marrying beautiful women, a claim that drew outrage from a human rights group.

Duterte was speaking to members of Tokyo's Filipino community last week when he mocked political opponent Sen. Antonio Trillanes. Duterte said a gay person told him Trillanes appeared to be gay, the Philippine website Rappler reported.

"I said, 'Are you sure?' They said, 'You ask any gay person who sees (him) move, they'll say he's gay,' " Duterte said. "No wonder. Good thing Trillanes and I are similar. But I cured myself."

Duterte said his ex-wife, Elizabeth Zimmerman, was the reason why, according to Rappler. Zimmerman was a flight attendant when they married in 1973. They split in 2000.

"When I began a relationship with Zimmerman, I said, this is it," Duterte told the crowd. "I became a man again."

More:Philippines ships 1,500 tons of trash back to Canada

Duterte's comments drew the ire of Jean Freedberg, the Human Rights Campaign's director of global partnerships.

“President Rodrigo Duterte’s outrageous remarks are just another attempt to divert attention from his administration’s long record against human rights,” Freedberg said. “Instead of making insulting and often nonsensical remarks about LGBTQ people and marginalized communities, it is high time that he takes action to end the well-documented human rights abuses committed by government and security forces officials across the Philippines."

CNN reported on the story, although its version cited Duterte's current partner, Honeylet Avanceña, for Duterte's commitment to women. Duterte and Avanceña have been linked since the 1990s, and they have a child together.

"I hated handsome men afterward," Duterte said. "I now prefer beautiful women."

Duterte has often used words that mean "gay" in his language to insult political foes. In 2016, Duterte used a homophobic slur to describe a U.S. envoy.

Duterte has waffled on his position on gay rights. He expressed acceptance of gays while running for the office he has held since June 2016. Rappler said that in March 2017, Duterte said marriage was only for a man and woman under Philippine law. By the end of the year, Duterte told an LGBTQ gathering that he thought the law could be changed to allow same-sex marriage.