A packed banquet room listens to presidential candidate Sen. Kamala D. Harris (D-Calif.) during the Black Enterprise Women of Power Summit in Las Vegas on Friday. (Melina Mara/The Washington Post)

SIMPSONVILLE, S.C. — Sen. Cory Booker gathered here recently with several dozen pastors, sharing a full-plated lunch with some of the state’s most influential religious leaders. Then, in a church gymnasium, taking the stage after a gospel singer, he quoted scripture, talked about a “moral moment” and decried President Trump for “igniting racism.”

More than 2,000 miles away, in a very different setting at the glitzy Mirage hotel and casino in Las Vegas, Sen. Kamala D. Harris was greeted at the Black Enterprise Women of Power Summit by a crowd that had been swaying and dancing to the beat. She answered questions about when she first knew she had “black girl magic” and noted that the chairwoman of her operation in Iowa — a state that is 91 percent white — is black.

In the early stages of the 2020 Democratic presidential contest, one with a historically diverse field, including Booker (N.J.) and Harris (Calif.) as prominent African American candidates, black voters have quickly become a highly sought-after electoral prize. The courtship is playing out in complex ways throughout the early voting states, a dynamic that will become more visible Sunday as several candidates appear in Selma, Ala., taking part in a remembrance of Bloody Sunday, when civil rights marchers in 1965 were viciously attacked by police as they crossed the Edmund Pettus Bridge.

Booker will speak at a church, and, in a twist, Sen. Bernie Sanders (I-Vt.) will attend a “unity breakfast” honoring Hillary Clinton, despite ongoing tensions between their two camps. Sen. Sherrod Brown (D-Ohio), who’s contemplating a presidential run, is also attending; Harris, who attended last year, won’t be at the event.

African Americans have long been a pillar of Democratic support, powering candidates from John F. Kennedy to Barack Obama. But in 2016, Sanders struggled to connect with black voters, and Clinton failed to inspire high African American turnout in the general election.

Democrats are determined not to repeat those mistakes. But black leaders and party strategists say the black community has transformed, with the emergence of a more independent, vocal and diverse younger generation, exemplified by such movements as Black Lives Matter, and the campaigns are scrambling to adjust.

Much of the initial action is centered on South Carolina, which follows Iowa and New Hampshire in the primaries and has a Democratic electorate that’s about 55 percent black, meaning it will provide a critical early test for several of the candidates.

Political strategy in the state has long revolved around influential church leaders and power brokers such as Democratic Rep. James E. Clyburn. But black voters even in the Bible Belt are becoming more secular, and alternative activist networks are springing up online and elsewhere.

Candidates face the challenge of appealing to younger voters who have flocked to South Carolina’s urban areas — and who lean on their own research more than the pronouncements of black leaders.

“This new group of millennials, we’re not sure when they vote, how they’ll vote or who they’ll vote for,” said state Sen. John Scott, a Democrat from Richland County. “They’re not beholden to anybody. They’re independent voters. That means these folks are keeping up with the issues.”

The 2020 candidates clearly recognize the need to appeal to African Americans. Their senior campaign staffs are more diverse than in previous election cycles, the issues they tout are more varied, and their messages are more often explicitly targeted at black people. But African American leaders in South Carolina say they will also have to find ways to reach rural black voters, for example, and persuade skeptics who feel previous candidates have offered little in return for a stamp of approval.

“We’ve seen politicians for years and years campaign at the African American community, because they thought the voting bloc — the monolith — would just vote with the party,” said Trav Robertson, chairman of the South Carolina Democratic Party. “Now they have to campaign to them instead of at them.”

With the race in its early stages, the campaign staffs generally do not yet have liaisons to the black community, and their strategies are still embryonic. Still, the small staffs for Booker and Harris in South Carolina are run by black organizers, and Sen. Elizabeth Warren (D-Mass.) has employed black staffers in key positions, including her Senate chief of staff, her national policy director and her national organizing director.

An unexpected flash point has emerged early as several candidates have been pressed on whether they support reparations for black families. Several candidates, without spelling out details, have said they do.

While looking for new ways to reach out, the candidates are also sticking to the traditional approach. James E. Speed, a pastor at Allen Temple AME in Greenville, has met with several of the candidates and is one in a long line of politically active black pastors who have served as opinion leaders and collar-wearing community organizers since the days of Jim Crow.

“I encourage people to vote,” Speed said. “I don’t tell them how to vote from the pulpit, but I do remind them of our values.”

Harris’s campaign has made a point of addressing people of color in each of the four early primary states. She addressed the Alpha Kappa Alpha sorority at its Pink Ice Gala in South Carolina, held a meeting with black leaders in Manchester, N.H., and spoke to the Iowa Democratic Party Black Caucus in Des Moines, as well as her appearance Friday in Nevada.

Harris has also done interviews with the “Breakfast Club” and the “Tom Joyner Show,” morning radio programs that reach large African American audiences, and sat for one-on-one sessions with the Root and the Grio, prominent online publications.

On specific policies, however, Harris has been cautious about touting initiatives aimed directly at African Americans, in some ways echoing Obama’s strategy and tone.

She often asks voters to think about what keeps them up at night, and to realize those worries “have nothing to do with some demographic a pollster put us into.” She talks about the struggles of the entire middle class, not African American families alone, and casts her tax-credit proposals as solutions for all financially struggling families. “We have so much more in common than what separates us,” she often says.

Still, Harris, who has attracted crowds and donations in the early going, has ways of signaling her sensitivity to racial issues.

She notes that maternal mortality rates are higher for black women. She talks of the injustice that black parents must give their children “the talk” about the dangers of racial profiling, and notes that the criminal justice system incarcerates African Americans at disproportionate rates. At nearly every stop, Harris brings up her education at historically black Howard University in the District.

Strategically, her first news conference after announcing her candidacy was at Howard, and she has reached out to her Alpha Kappa Alpha sorority sisters, a group with a nationwide network.

Booker has framed his personal story as intertwined with the broader civil rights movement. He often tells voters of how his parents faced discrimination in the 1960s as they attempted to buy a home in a white neighborhood in New Jersey. One of the people who came to their aid was a white Jewish lawyer who later told Booker he was inspired to help families facing housing discrimination after watching the marchers beaten by troopers on the Pettus Bridge in Selma.

“I would not be here today, running for president of the United States, if it was not for this chain reaction of love,” Booker said in South Carolina.

The anecdote reflects the importance of Bloody Sunday in the history of the civil rights movement, and it helps explain why several of the candidates are attending Sunday’s events, even though Alabama is not itself a critical primary state.

While African American candidates such as Harris and Booker are making it clear their concerns go far beyond the black community, hopefuls like Warren and Sanders, who are white, have been striving to show through rhetoric and outreach that they grasp the issues facing African Americans.

Rep. John Delaney (D-Md.), who is white, recently visited South Carolina. “I can never fully appreciate what it’s like to be African American in the United States of America, as I’m not,” he said in an interview. “But what I can do is stand up [to] racism and actually try to change policies.”

Yet his audience of 70 during an event this past week in South Carolina had no black people in the audience outside the press.

Sanders, whose 2016 run electrified many young voters but generally not African Americans, has been open about placing more emphasis on courting nonwhite voters this time around.

“We have been criticized — correctly so — for running a campaign that was too white and too male-oriented,” Sanders said recently on the Young Turks, a liberal online show. “And that is going to change. We are going to have a very, very diverse campaign staff and we’re going to do a better job of reaching out to every community in this country.”

Gilda Cobb-Hunter, president of the National Black Caucus of State Legislators and a veteran South Carolina Democrat, has observed more aggressive outreach by Sanders to communities of color, she said in a recent interview. But she also said he could face more challenges because his competition this time includes multiple candidates of color.

Other candidates are seeking to connect in different ways. Former congressman Beto O’Rourke, a Democrat from Texas who is expected to enter the presidential race shortly, had a viral moment in his recent Senate campaign during which he defended NFL players who knelt during the national anthem to protest racism and police brutality. The clip was tweeted by LeBron James, and Beyoncé posted photos of herself in a Beto hat.

Warren’s first trip to South Carolina included a stop at the studios of the Big DM 101, a Sumter-based radio station popular in the black community. Topics included affordable housing and her decision to drop out of college when she got married.

“I’ve been through a lot of these things,” Warren said, noting that she graduated from the University of Houston, which she called a commuter college, and whose other attendees include rapper Lil Wayne and TV personality Star Jones.

Warren often mentions racial justice, even to largely white audiences in New Hampshire, and says income disparities disproportionately affect black communities. At nearly every stop, she decries redlining, the policy of denying mortgage aid and other services to black neighborhoods.

She’s made two trips to South Carolina, visiting Greenville and Columbia, and held a town hall in Gwinnett County, Ga. In the 2016 Georgia Democratic primary, 51 percent of voters were black, according to exit polling.

It’s not yet clear how effective the outreach has been. On a recent trip to Greenville, Warren attracted a mostly white audience, even though the event was held at a community center associated with an important black church.

When a reporter asked how she planned to attract more diverse crowds, Warren said, “I’m just going to keep coming back.”

Annie Linskey, Chelsea Janes and Sean Sullivan contributed to this report