LAS VEGAS — Pete Buttigieg sought to diffuse weeks of fraught questions about white privilege and his struggles attracting minorities to his campaign by calling out fellow Democrats on Saturday for playing “identity politics” and pitting one group’s grievances against another’s.

In a risky speech to the Human Rights Campaign, a major LGBT rights group, Buttigieg warned of a “crisis of belonging in this country,” arguing it was exacerbated by “so-called identity politics” that emphasize how one person hasn’t walked in another’s shoes — “something that is true, but it doesn’t get us very far.”

He drew a direct line between the obstacles faced by a black, trans woman excluded by mainstream society and an out-of-work auto worker excluded by the new economy.

“What I worry about is not the president’s fantasy wall on the Mexican border that’s not going to get built anyway,” Buttigieg said. “What I worry about are the very real walls that we are putting up between us as we get divided and carved up.”

For Buttigieg, it was the culmination of almost daily interrogation on the campaign trail about what may be his most significant liability as a Democratic primary candidate: The nagging concern that as a white man with a Harvard and Oxford pedigree, he’s the wrong candidate at a moment when Democrats seem to be pining for someone who can embody the lingering inequities faced by less-privileged minorities. That comes despite the fact that Buttigieg, if elected, would be the first openly gay president.

Buttigieg’s supporters have been energized by the notion that as a Democratic, Midwest mayor in a conservative state who speaks fluently about his faith, he seems uniquely positioned to win back the type of voters who abandoned Democrats in 2016 and helped elect President Donald Trump: white, working-class voters, especially in rural areas. But what could be a key advantage for Buttigieg in a general election has become an albatross in the Democratic primary.

So Buttigieg used a venue where he has the most credibility — a gathering of well-heeled LGBT activists — to try to pre-empt that vulnerability before most Americans have fully tuned into the primary.

In doing so, Buttigieg offered the most pointed critique of his own party so far in the campaign, in a moment that had echoes of Bill Clinton’s “Sistah Souljah” moment in 1992 when he distanced himself from a black political activist who had made controversial comments about race.

“When an auto worker, 12 years into their career, is no longer sure how to provide for their family, they’re not part of the country we think of ourselves as all living in together. That’s why we can’t seem to get on the same page,” Buttigieg said.

Such "divisive lines of thinking” have entered Democrats’ mindset, Buttigieg said, adding: “Like when we’re told we have to choose between supporting an auto worker and a trans woman of color, without stopping to think about the fact that sometimes the auto worker is a trans woman of color, and she definitely needs all the security she can get.”

At least in the room at the Human Rights Campaign gala, his remarks appeared well-received. As he left the stage to applause, he was followed by black transgender singer Shea Diamond, who soulfully crooned the lyrics to her song “American Pie.”

“Just want my piece of the American pie. Got your slice, where is mine?” she sang.

Buttigieg also called out Trump on several occasions, saying that many of the objections to identity politics “come from the right, which is ironic at this time because the current administration has mastered the practice of the most divisive form of such politics, which is white identity politics, designed to drive apart people with common interests.”

He said he’d be “happy to debate marriage with this president” — a reference to Trump’s three marriages — and called out casino mogul and billionaire Republican donor Sheldon Adelson by name while standing inside a ballroom in Caesar’s Palace on the Las Vegas Strip.

“I know I’m a guest in Sheldon Adelson’s town,” Buttigieg said, prompting boos from the crowd at hearing Adelson’s name. “But I know … that real democracy means that the voice you have in our political process is gauged by the merits of what you have to say and not by the number of zeros in your bank balance.”