HUNTSVILLE, Ala. — New Jersey Sen. Cory Booker traveled to Alabama to campaign for Democratic Senate nominee Doug Jones on the final weekend before voters go to the polls.

But the clear subtext of Booker's visit was the 2020 presidential election.

While this red state isn't competitive in general elections at the presidential level, Alabama and other Deep South states can be pivotal in Democratic primary races. As Barack Obama and Hillary Clinton demonstrated, a contender who can consolidate the support of African-American voters in this part of the country has a major advantage in trying to win the party's nomination.

"For any candidate that's interested in running in 2020, Alabama is in play. We're going to be a player," state Rep. Anthony Daniels, Alabama's first black House minority leader, said after Jones spoke to a Baptist congregation here.

While Booker's known to political insiders in Alabama, Daniels said, this campaign swing for Jones will make him a more familiar figure among rank-and-file voters. "It probably helped him, too," Daniels said.

With @GDouglasJones, visiting churches in Birmingham this morning. So grateful for the rousing greeting we are receiving at every church. The energy is so uplifting. Alabama votes on Tuesday. pic.twitter.com/6xero2ZLSU — Cory Booker (@CoryBooker) December 10, 2017

At a rally in Birmingham on Sunday afternoon, Booker was asked by a reporter why a New Jersey senator would come to Alabama — and he stressed his ties to the state.

"My roots go into this state. My family were coal miners in the state of Alabama. I owe a debt to Alabamans, and I can’t pay it back — those generations have passed — but I can pay it forward," he said. "I’m here to try to let folks know how special this community is, how special this state is."

As he spoke, a man in the crowd shouted, "Booker 2020!"

Asked about that, Booker deflected by noting that his Senate seat is up the same year.

Still, Booker had an opening to lay some political groundwork that wasn't available to all of the 2020 hopefuls. For the most part, Jones' campaign wanted national-level Democrats to stay out of the state, fearing that his opponent, Republican Roy Moore, would attack Jones for involving outsiders in the race.

When former Vice President Joe Biden came to the state in October, Republicans seized on his appearance to tie Jones to national Democrats and interest groups that align with them.

But the Jones camp's informal embargo on Democratic heavyweights did not apply to members of the Congressional Black Caucus, as the candidate's hopes hinge in part on mobilizing black voters. Democratic Rep. Terri Sewell, the only African-American in the state's nine-member congressional delegation, organized appearances by several black lawmakers over the weekend.

Booker is one of three black Democrats who are often mentioned as potential presidential contenders in 2020. One of the others, former Massachusetts Gov. Deval Patrick, also campaigned with Jones. The third, California Sen. Kamala Harris, had looked at the possibility of going to Alabama but had a scheduling conflict, according to one of her aides.

Newark Mayor Cory Booker takes the stage to speak during day one of the Democratic National Convention at Time Warner Cable Arena on Sept. 4, 2012 in Charlotte, North Carolina. Joe Raedle / Getty Images

She has found other ways to support Jones, the aide said, including headlining a Democratic Senatorial Campaign Committee event for Jones in Washington; raising nearly $170,000 for him using her e-mail list; signing onto a MoveOn.or appeal for him that netted more than $200,000 for him; and donating $5,000 from her political action committee.

Though Jones' focus in the final days of the campaign has been on turning out black voters, who account for about 27 percent of the state's population and made up 19 percent of the electorate the last time a Democrat, Don Siegelman, was elected governor in 1998.

Jones has become a cause célèbre for national Democrats — across the racial and ideological spectrum — because Moore has been accused of sexual misconduct with teenage girls and because they abhor his record and comments on same-sex marriage, issues of importance to racial and religious minorities and other matters. But most elected Democrats have offered their support from a distance and stayed out of the state.

Not Booker, who surely knows the value of African-American voters in Democratic primaries in the South.

In 2016, Clinton beat rival Bernie Sanders in the Alabama primary with 78 percent of the vote. Her victory was fueled by 91 percent support among black voters, who accounted for 54 percent of the electorate, and she took 44 of the state's pledged Democratic convention delegates to Sanders' nine.

That 35-delegate margin was her fourth largest in the country, behind only Texas, Florida and Georgia. And Clinton, who claimed 359 more pledged delegates than Sanders did nationwide, netted a 153-delegate edge in the Deep South states of Alabama, Georgia, Mississippi, South Carolina and Louisiana, according to a calculation of Green Papers data.

She won those states handily because of the near-monolithic support she had among African-American voters, who accounted for half or the majority of the Democratic primary electorate in each of them. And all of them voted early in the primary process, helping her to stake out a big lead and build the narrative that Sanders could not overtake her. Similarly, Obama relied on the backing of African-American voters to defeat Clinton for the 2008 Democratic nomination.

The question for Booker and any Democratic presidential hopeful in 2020 is whether he or she can repeat the performances of Clinton and Obama in consolidating African-American support, or if black voters here and in states with similar demographics will split among the eventual contenders. It's far too early for voters to start making those kinds of decisions, but not for candidates to begin subtly wooing them.

In interviews with NBC over the weekend, some voters said they were aware of Booker before his weekend swing through the state.

Huntsville resident Marilyn King, 61, said it was "courageous" that Booker had lived for years in a foundering housing project in Newark so that he could immerse himself in the community and "honorable" that he came to campaign for Jones.

"There's something about Southern people: We don’t forget things too easily," she said. "I think we’re appreciative of him coming down. But we’re going to watch him and see where he goes. So far he's looking good."