WASHINGTON — Pete Buttigieg may not become president or win the Democratic primary, but he's already broken a barrier by delving publicly and intimately into his struggle with his own sexuality in a way no other serious presidential candidate has.

In a speech before an audience of LGBT rights supporters on Sunday, the mayor of South Bend, Indiana, did not describe being gay as something he always believed was acceptable. Nor did he dismiss lingering questions about his viability as a presidential candidate in a country in which three in 10 adults still say they have some reservations or would be very uncomfortable with a gay candidate, according to an NBC News/Wall Street Journal poll in February.

Instead, he described wrestling with his sexual orientation as “a kind of war” — one he said he was only able to win when he came home from serving in Afghanistan. As a youngster in high school and college, he said, the situation was very different.

“If you could have offered me a pill that could make me straight, I would have swallowed it before you could give me a swig of water,” Buttigieg said at the LGBTQ Victory Fund’s annual brunch. “It’s a hard thing to think about now. If you had shown me exactly what it was that made me gay, I would have cut it out with a knife.”

He added later: “Thank God there was no pill. Thank God there was no knife.”

Although he is not yet a full-fledged candidate — the Democrat has teased an announcement on April 14 — there are already indications that his party is taking him seriously as a presidential contender. He announced a $7 million fundraising haul for the first quarter of 2019, and his campaign events have been packed with growing crowds hoping for a firsthand look at the young mayor from the industrial Midwest.

On the trail, Buttigieg has emphasized how he and his husband are similar, not different, from heterosexual couples across the country, hoping to defuse an issue that evangelicals and other opponents of same-sex marriage could raise if he becomes the nominee. Taking direct swipes at Vice President Mike Pence, he said his marriage last year to schoolteacher Chasten Buttigieg had made him a better man, “and yes, Mr. Vice President, it has moved me closer to God.

“That’s the thing I wish the Mike Pences of the world would understand: That if you have a problem with who I am, your quarrel is not with me,” Buttigieg said. “Your quarrel, sir, is with my creator.”

Pence, who has opposed gay rights policies such as legalizing same-sex marriage, was governor of Indiana when Buttigieg came out as gay after returning from serving in Afghanistan — at the same time as he was seeking re-election as South Bend's mayor.

For young voters who came of age in an era when same-sex marriage is legal and the gay rights movement has notched significant other victories, the prospect of a gay White House candidate may not seem far-fetched, or even unusual.

But the majority of America’s voters grew up at a time when gays and lesbians were barred from serving openly in the military and state laws were on the books outlawing sexual acts between adults of the same gender — which the Supreme Court reversed in 2003.

Running for president as an openly gay person — and speaking emotionally about sexuality — would have been unthinkable, said Richard Rosendall, a 63-year-old from Washington who said he’s been a gay rights activist since 1973.

“For somebody my age and older, it’s something that many of us certainly would have hoped for, but never expected to happen,” Rosendall said.