Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Obama fired up a largely African-American crowd of more than 9,000 in Greensboro, North Carolina, Tuesday night, the very voters who could mean the difference between Hillary Clinton taking the state and a narrow Donald Trump victory.

For 45 minutes Obama lambasted Trump, making a direct, head-to-head comparison against Hillary Clinton on various issues, including the environment, the economy, and transparency.

“You’ve got everything to lose,” he told the crowd, “All the progress we’ve made these last eight years is on the ballot.”

Related: RNC Hires Deputy Director for African American Engagement

It's a state Obama narrowly won in 2008 and lost by two points in 2012. Polls show Clinton with an extremely slim lead here, and turnout, especially among the black population, will be critical.

"President Obama is an incredible ace in the hole for the Hillary Clinton campaign," said Frank Baumgartner, professor of political sciences at University of North Carolina at Chapel Hill.

And it’s clear the president feels very comfortable in Greensboro. Despite being heckled by protesters three times, he deftly brought the attention back to him and the hugely friendly crowd shouted the protesters down.

He joked Trump wouldn’t get a job at 7-11 after the lewd comments captured on a hot mic in 2005, and asked why so many Republicans continue to stick by the businessman turned reality-TV star turned candidate.

“Why'd it take so long for some of them to finally do walk away?" Obama asked. "I mean, we saw this coming. He's been saying really bad stuff for a while now. What'd you think? He was just going to transform himself? I mean, I'm 55 and it's hard for me to change. I know at 70 it's going to be harder."

Clinton and Trump have both visited the Tar Heel state four times in the last month, not to mention many of their high profile surrogates.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Chante McNeil was just 11 years old when Obama first won the presidency and she remembers how powerful the moment was for her parents and grandparents.

"I wanted to get a chance to have my vote mean something," she said, determined to vote for Hillary Clinton. But the 19-year-old African American didn't hesitate when asked who she prefers between the two Democrats.

"Barack Obama, no contest," she said.

Despite President Obama's popularity among African Americans in North Carolina, Baumgartner believes black turnout will not be as high as when he won in 2008 — when he became the first Democrat to carry the state since Jimmy Carter in 1976.

US President Barack Obama greets supporters as he arrives in Greensboro, North Carolina, October 11, 2016. JIM WATSON / AFP - Getty Images

"It will be tough to beat that historic high," Baumgartner said.

Twenty-two percent of the electorate in North Carolina is black, 70 percent is white and about 2 percent identify as Latino.

President Obama has done several interviews with black radio stations and frequently touts a vote for Hillary Clinton as a vote to continue his legacy. Earlier Tuesday, he taped a town hall to air on ESPN on race and sports at North Carolina A&T State University, a historically black college.

North Carolina Republican Chairman Dallas Woodhouse believes Republicans are in good shape in his state.

"After the 2008 elections, there were 800,000 more registered Democrats than Republicans. Obama won by 14,000. That gap narrowing by 150,000 bodes well for turnout," Woodhouse said in an email.

There are a few factors complicating turnout predictions in North Carolina as voters are still grappling with a few controversial issues including an anti-transgender bathroom law, voter id laws and police-community relations.

Related: Trump's History Undermines New Outreach to Black Voters

Recent controversies over Governor Pat McCrory's HB2 bill, voter id laws, and protests over the police-shooting of Keith Lamont Scott have polarized the North Carolina electorate and complicated turn out predictions this cycle, Baumgartner said.

He added that top state Republicans have already taken a defensive position and might further be hurt by Donald Trump's 2005 lewd comments about groping women's genitals.

But for Obama Tuesday, turnout was still the focus.

“Send a message by voting for Hillary Clinton,” Obama shouted.

Just a 10 minute drive from where the president's rally for Clinton took place is the original Woolworth's counter where four black college students sparked a landmark protest during the civil rights movement by refusing to leave until they were served.

President Barack Obama attends a town hall interview with ESPN anchor Stan Verrett on "sports, race and achievements" at North Carolina Agricultural and Technical State University in Greensboro, North Carolina, Oct. 11. CARLOS BARRIA / Reuters

The counter is now the centerpiece of the International Civil Rights Center in downtown Greensboro. On a morning tour, guide Anita Johnson vividly explained the history and related those experiences to modern day residents — from the struggles with police to poll taxes and voting rights.

The last exhibit on the tour is a huge wall mosaic of pictures of civil rights icons, with a giant image of President Barack Obama laid over.

"It's only 51 years since black people have had the right to vote," Johnson explained earlier Tuesday. And she turned, she broke into a wide smile. "I have three words for you: President Barack Obama."

She had a ticket to attend the rally just up the road, later in the day.