The controversial president of Philippines claims he was cured of being gay before meeting his ex-wife.

During a speech in Japan, President Rodrigo Duterte mocked his political opponent for moving like a homosexual. Then he confessed he, too, used to be gay but “cured himself,” according to Rappler.

In his comments, Duterte started by accusing Senator Antonio Trillanes IV, a chief critic of the president, of acting like a gay man. He said someone else had asked him about the senator’s sexuality.

"I said, 'Are you sure?' He said 'Ask any gay man and see that moving, they say that's gay,'" Duterte said. "Well, well, Trillanes is just like us, but I got myself treated."

Duterte went on to say it was his relationship with Elizabeth Zimmerman, who was married to him for 25 years. Zimmerman filed for an annulment in 1998, telling courts her husband was a “womanizer,” Rappler previously reported.

Now Duterte said it was Zimmerman who put in on the straight path.

“I became a boy again,” he said in Filipino.

Duterte’s history of homophobic accusations, continued with his attack on Trillanes, puts the revelation in an odd context.

He’s accused other political figures of being gay as well in the past, including U.S. Ambassador Philip Goldberg in 2016. At the time, Duterte said he could work with U.S. Secretary of State John Kerry but had problems with the ambassador to the Philippines.

"I quarreled with [Kerry’s] gay ambassador. I am pissed with him. He meddled during the election, giving statements here and there," he said. "He was not supposed to do that. That son of a bitch really annoyed me.”

A year later, he called Chito Gascon, chairman of the Philippines Human Rights Commission, of being a pedophile. “Why is this guy so ... suffocated with the issue of young people, especially boys?... Why are you smitten with teenagers? Are you? I’m having my doubts. Are you gay or a pedophile?”

But he’s also come out in favor of marriage equality, and with his recent remarks, he swears he has no problem with people being gay, despite using the accusation to deride opponents repeatedly.

As he closed his remarks in Japan, he said he had no problem with people knowing his past.

"Duterte is gay. Eh, I'm gay. I do not have that kind of anxiety or not," he said in Filipino.