Presidential hopeful Pete Buttigieg, the openly gay mayor of South Bend, Indiana, received a huge round of applause on Saturday when he told a crowd in Iowa that leaders from countries where being gay is illegal will have to “get used” to dealing with a gay president.

Buttigieg made his comments during a town hall at Decorah High School.

“How do you intend to deal with international leaders from countries like Saudi Arabia and Russia where it's illegal to be gay?” an audience member asked.

“So, they're going to have to get used to it,” Buttigieg answered.

Buttigieg's response received 27 seconds of applause from the audience.

(Related: Pete Buttigieg surges in Iowa; closes in on Elizabeth Warren, Bernie Sanders, Joe Biden.)

“One great thing about America is that when we’re at our best, we have challenged places around the world to acknowledge freedom, and include more people in more ways,” Buttigieg continued. “And whether it is by policy or just by example, America is at her best when we have done that.”

“Not every country is there, and my real concern is not how those leaders are going to treat me – they’ll treat me as the president of the United States when we interact as nations do. The problem, of course, is how [LGBT] people are being treated in those countries,” he said.

Gay sex is punishable by death in Saudi Arabia and more than 70 additional countries. Russia has a law that prohibits “gay propaganda,” making it difficult for LGBT rights groups to organize. In both nations, anti-LGBT rhetoric – even from leaders – is commonplace.

Buttigieg said that his election as president would have a positive impact on LGBT people around the globe.

“I do believe that one big step forward would be for a country like the United States to be led by somebody that [LGBT] people in those other countries can look to and know that they're not alone,” Buttigieg said.