GOLDSBORO, N.C. — Pete Buttigieg, the 37-year-old mayor who has turned the heads of mostly white voters in Iowa and New Hampshire, bowed his head Sunday in a church founded by ex-slaves.

The Greenleaf Christian Church is pastored by the Rev. William J. Barber II. Barber’s effort to revive Martin Luther King Jr.’s last major project — the Poor People’s Campaign of 1968 — has inspired a multiracial movement to oppose President Trump, with plans for an assembly and “Moral March on Washington” in June 2020.

Buttigieg’s decision to worship with the Disciples of Christ congregation underscored the task that awaits him as he seeks to convince voters that he can credibly lead a diverse coalition to capture the White House.

“I believe that I am here to make myself useful — that I am part of this political process to make myself useful, but also that I was put on this Earth in order to make myself useful to others,” Buttigieg told more than 100 members of the mixed-race congregation who stayed following the Sunday service to witness the candidate field questions for two hours from Barber, along with other faith leaders, activists and voters. “These are the values that I was taught by my parents. These are the values that I’m taught by my faith.”

Buttigieg, an Episcopalian, has framed his faith as a counterpoint to the religious right. And scripture became the common ground between the soft-spoken mayor — clad in his signature dark suit — and the pastor with a clergyman’s collar and gold-accented clerical stole. When Buttigieg, arguing the biblical case for welfare, remarked that he couldn’t “count the number of times the word ‘poor’ shows up in scripture,” Barber supplied an answer. “2,000,” he interjected.

The 56-year-old pastor pointedly declined to ask Buttigieg about his sexuality, saying he would no more put the question to an airline pilot. “But I did ask him, ‘Could he fly the plane?’ ” Barber remarked, as applause rang out in the pews.

Barber was hardly silent on the theme, however. He opened the service by denying that anti-gay hostility was pervasive in the black community. “Stop putting that on black folk,” Barber preached. “There’s some phobia among all folks.”

He called the notion of a rift between gay people and blacks a “false narrative that was created by the National Organization for Marriage to separate people who, when they come together, have always pushed America forward, especially when it comes to addressing issues like poverty and health care.”

Buttigieg, addressing reporters after he left the sanctuary, said, “I don’t think I could say it any better than that.”

In recent days, the candidate has suggested that his identity as a gay man gives him greater empathy with the experiences of other marginalized groups — a point that raised eyebrows among some members of the black community, including Sen. Kamala D. Harris (D-Calif.).

But the argument resonated with Raymond E. Smith Jr., a black state representative in North Carolina who attended Sunday’s service and discussion. “Not a lot of white men know what it’s like to be discriminated against,” Smith said. “But he brings to the table personal experiences that would be beneficial.”

Others were more skeptical of the mayor, whose experience in elected office is limited to stewarding South Bend, Ind., a city of just over 100,000. Buttigieg has faced criticism of his record on race and policing in his hometown.

“Anyone can say anything,” said Yolanda Peterson, 36. “Let’s wait and see.”

Barber neither endorsed the mayor and veteran of the war in Afghanistan nor confronted him over areas where his policy prescriptions diverge from those of the Poor People’s Campaign.

For instance, the anti-poverty campaign co-chaired by Barber calls for a single-payer health care system, while Buttigieg favors a less sweeping overhaul and has assailed his left-wing rivals for their support for so-called Medicare-for-all.

“My plan is to make sure everybody is insured,” Buttigieg assured a woman who rose to describe the experience of burying her son, who had lacked coverage. Meanwhile, the candidate touted the benefits of public education by describing the value of “shared things,” even as he has criticized some of his competitors’ plans for tuition-free public colleges and universities.

Buttigieg also sat for a lesson of sorts, as Barber displayed slides showing maps aimed to illustrate the overlapping effects of voter suppression, poverty and other scourges. The minister said all presidential candidates were welcome to come to Goldsboro to discuss poverty. Nine of them appeared over the summer at a forum hosted by the Poor People’s Campaign in Washington. Barber is pressing for a presidential debate on poverty and racism.

Buttigieg called that debate “imperative” as he issued a “moral call to unity” designed to “confront all of the interwoven and interlocking sources of systematic poverty and systematic racism.”

“We’re going to need a leader who can bring us together from the White House in order to confront these concerns,” he told reporters before departing for neighboring South Carolina, part of a several-day swing through the South that will also take him to Alabama.

Polling indicates Buttigieg has his work cut out for him. In a Quinnipiac survey released Nov. 18, he registered at 6 percent overall in South Carolina, trailing former vice president Joe Biden, who enjoyed a comfortable lead, as well as Sens. Elizabeth Warren of Massachusetts and Bernie Sanders of Vermont. Forty-seven percent of respondents said they had not heard enough about the 37-year-old mayor to form an opinion of him.

If he is to energize the coalition envisioned by Barber — which cuts across racial and economic lines — Buttigieg has ground to make up not simply in the black community but among the poor voters whom the minister sees as their natural allies. In an earlier Monmouth University poll of likely Democratic voters in South Carolina, he registered at just 2 percent among those making less than $50,000 a year.

Barber said the conversation on Sunday represented a start.

“He came, he listened and he learned,” Barber said in a brief interview after Buttigieg had rolled away in his black Suburban.