Mayor Pete Buttigieg has delivered a provocative response in recent days to those who challenge his empathy with black Americans: His experience as a gay man helps him relate to the struggles of African Americans.

That has angered some African Americans, who view it as an attempt by a privileged white man to claim a type of victimhood that is distinct from the black experience in America, even while others take the comments more favorably.

Oliver Davis, a black council member in South Bend, Ind., where Buttigieg is mayor, said that African Americans, unlike gay people, don’t have the option of “coming out” at their chosen moment — as did Buttigieg, who disclosed his sexual orientation after he had been elected mayor.

“When you see me, you would know that I’m African American from day one,” said Davis, who has endorsed former vice president Joe Biden. “When someone is gay or a lesbian, unless they tell or they are seen in certain situations, then no one is going to know that. They are able to build their résumés and build their career.”

LGBT activists see something different in Buttigieg — a barrier-breaker from a group that has long faced bigotry and violence, a face of the latest struggle for inclusion. And while some successfully conceal their difference, say leaders of the movement for gay equality, that decision can come with its own steep costs.

Evan Wolfson, founder of Freedom to Marry, which helped lead the fight for same-sex marriage, said Buttigieg’s message is not “an attempt to appropriate someone else’s experience.” Rather, he said, the mayor is saying that “because he, too, has had to deal with his own struggles, that has made him more aware of the need to connect with the struggles of others.”

That question — how to square Buttigieg’s privileges with the adversity that comes with anti-gay prejudice — is becoming sharper as the 37-year-old Afghan war veteran rises in the polls and scrambles for ways to connect with black voters. And it renews the issue of how Americans, of any background, will respond to the candidacy of an openly gay man, one who holds hands with his husband and publicly discusses his decision to come out.

The debates are unfolding against a significant shift in the politics of identity. The #MeToo and Black Lives Matter movements continue to resonate, and the successful push for marriage equality hardly marked the culmination of the quest for a fuller set of LGBT rights. As President Trump inflames America’s divides, the Democratic Party is fielding the most diverse set of presidential candidates in history.

Buttigieg has shot to the top of the polls in Iowa and is gaining strength in New Hampshire, two largely white states — but he trails badly in South Carolina, the first primary state with a sizable African American population. A recent poll gave him less than 1 percent support among black Democrats there.

The mayor’s current efforts to find common ground are prompting raw feelings, including his comments at the last Democratic debate when the question of race arose.

“While I do not have the experience of ever having been discriminated against because of the color of my skin, I do have the experience of sometimes feeling like a stranger in my own country, turning on the news and seeing my own rights come up for debate, and seeing my rights expanded by a coalition of people like me and people not at all like me,” Buttigieg said.

That drew a sharp response, including from Sen. Kamala D. Harris (D-Calif.), a presidential hopeful and the only black woman in the U.S. Senate. “What he did on the stage, it’s just not productive, and I think it’s a bit naive,” she told CNN after the debate.

Other African Americans agreed, feeling that Buttigieg was implicitly comparing his experience to the unique struggle of black Americans, in a misguided effort to show his empathy.

“I think Kamala had a point, and I understood what she was saying,” the Rev. Al Sharpton, the civil rights activist, said in an interview, though he added that Buttigieg had been misunderstood.

He said Buttigieg is doing his best to reach out. “He’s evolving,” Sharpton said. “Do I think he’s where he needs to be? No.”

The prospect of tension between the black and gay communities worries some people in both groups. “Can’t y’all stop this mess?” Alvin McEwen, a black LGBT activist from South Carolina, recalled thinking to himself amid the furor following Buttigieg’s comments.

“No group wants to have the autonomy of their narrative taken by another group,” McEwen said. “But it also typifies how both communities want to grab on to power and don’t want to listen to each other.”

Asked about the comments during his recent campaign swing in western Iowa, Buttigieg said he was not trying to compare the black and gay experiences, only to say that he is driven to fight for African Americans the way others have fought for him.

“It was people like me and people not like me who came together — starting before I was born and through my lifetime — who have made it possible for things like my marriage to exist, or honestly for somebody like me to even be taken seriously as a candidate for president,” Buttigieg said.

“Having seen that, having seen how that alliance can make an impact, makes me reflect on how I can turn around and make myself useful, not only to the LGBT community but to people whose life experiences are very different,” he added.

That resonates with many in the gay rights community. Matt Foreman, program director of the Evelyn and Walter Haas Jr. Fund, which advocates for marriage equality, among other causes, said it’s not a given that being gay gives someone greater empathy for the struggles of people of color.

“But it should,” he said. “It can’t be the same, because you can never get inside anyone else’s skin. But I see that in a lot of LGBT organizations and their sincere commitment to helping address systemic racism.”

Foreman acknowledged that LGBT groups have sometimes fallen short. “We as members of the gay movement have often failed to appreciate the need to be there for other communities,” he said. He cited police shootings, which sometimes prompt an outcry among gay activists and other times a reaction that “this isn’t our issue.”

Wolfson, of Freedom to Marry — now defunct, having attained its goal — said the unhappiness with Buttigieg among many black voters, including in his hometown of South Bend, illustrates that the mayor “undoubtedly has more work to do.”

Adding to his challenges, Buttigieg was forced to respond recently to a harshly worded article in the African American-oriented website the Root, which denounced Buttigieg’s comments from years ago that part of black students’ problem is a lack of successful role models. The author, Michael Harriot, called Buttigieg a liar for omitting the role of systemic racism.

Buttigieg on Tuesday called Harriot to explain his remarks and listen to his critic’s views. And when a voter asked Buttigieg about the article at a town hall in Sioux City, Iowa, the candidate said the author had been right, adding, “We’ve got to look at the structural factors that drive different racial outcomes in our country.”

He also cited his “Douglass Plan” for tackling institutional racism, a proposal for sweeping changes in health care, education, employment and criminal justice, among other areas.

As an ongoing part of his outreach, Buttigieg plans to worship Sunday at Greenleaf Christian Church in Goldsboro, N.C., which is led by the Rev. William Barber II, a well-known minister and activist.

Barber said in an interview that in today’s polarized climate, candidates are often surprised to find so much diversity in his church — blacks, whites, gays, lesbians.

“Let’s not get caught up in who understands discrimination the most,” Barber said. “Let’s deal with the real issue, which is that the same entities that are against gay folks are the same entities who are against black folks, and that we ought to be united in fighting discrimination in any form it arises.”

Buttigieg from the outset of his campaign sought guidance in how to frame his gay identity when talking with black voters. Two weeks after announcing his run for president, he lunched with Sharpton at Sylvia’s, a famous restaurant in Harlem.

“He wanted to genuinely know how I felt the African American community would relate to an LGBT candidate,” Sharpton said. The activist told Buttigieg something other black leaders have also said — that the level of homophobia in the black community has been greatly overstated.

McEwen said it is clear why some black voters are hesitant to support Buttigieg, noting that many of his qualifications are shared by a female candidate or a person of color, yet they have received far less buzz. He served in the military, but so did Rep. Tulsi Gabbard (D-Hawaii). He made a name in local politics, but so did Sen. Amy Klobuchar (D-Minn.).

“I think the fact that he’s a white male is a far bigger problem than being gay among blacks in South Carolina,” McEwen said. “Because of the white male power structure, he’s gotten a lot more public attention than people who are senators. He’s only been a mayor.”

Beyond that, black voters give various reasons for distrusting Buttigieg, including his handling of race relations in South Bend. But a recurring theme is the sense that Buttigieg benefits from his privileged status without recognizing that he enjoys these advantages.

Buttigieg denies that, saying he is well aware of his advantages, and this week he pledged “increased engagement and new forms of engagement,” though he did not go into detail.

Buttigieg has also said his challenge with black voters is that few know him. But his detractors say they know exactly who he is: a well-intentioned white liberal who credits himself with more insight into the black predicament than he has.

“He gets to be cast an all-American boy in the race, as if black people cannot be all-American,” McEwen said. “Could you imagine if he were black and gay? Good lord, it would be a miracle that anyone would vote for him.”