Former Mayor Pete Buttigieg on Thursday joked about his sexuality, saying his political success as a gay man was all part of “God’s sense of humor.”

After winning the Iowa caucuses, more media figures and pundits began speaking about Buttigieg’s surprising political milestone for the gay community.

In a CNN town hall, Buttigieg was asked about it by host Chris Cuomo.

The former South Bend mayor explained that at one point in his life he would have “done anything to not be gay,” because he was worried he would never get to serve in the military or run for public office. But he said he was grateful his sexuality was having a big impact in the gay community, by reaching milestones for the first time in electoral politics.

“I’m not running to be the gay president of the United States; I’m running to be a president for everybody,” Buttigieg said. “But talk about God having a sense of humor…”

Buttigieg made the same joke in an appearance with late-night comedian Stephen Colbert.

“You know, the very same thing that I thought might mean I would never get to serve in uniform or in office turns out to be — talk about God having a sense of humor — it turns out to be part of how I’ve had a chance to make a difference,” he said.

Buttigieg has threaded his struggle as a gay man into his campaign message, telling all Americans that they “belong” despite all of their differences and struggles.

“I know there’s a lot of young people out there wondering if they fit, feeling like maybe they don’t belong in their communities, maybe even questioning if they belong in their own families,” he said. “And hopefully this is one significant bit of proof that they belong after all and they belong in this country.”