Jonathan Ernst / Reuters

CHARLOTTE, N.C.—Four years ago, Hillary Clinton’s husband stepped up to a lectern at the convention center in Charlotte and delivered one of the most pivotal speeches of Barack Obama’s presidency. On Tuesday, Obama returned to the Queen City to try to repay the favor to Clinton, who’s now vying to succeed him.

After leading the crowd in a “Hil-la-ry!” chant, Obama strode to the microphone. “I’m fired up!” he said. “Hillary got me fired up.”

And he was. Speaking for more than half an hour in his first appearance with his would-be successor, the president showed that aides who insisted he was raring to get back on the campaign trail weren’t making it up.

Obama was folksy and loose, jacketless and with sleeves rolled up, and he grinned broadly as he bonded with the crowd and took a series of shots at Donald Trump, the presumptive Republican nominee. While praising Clinton at length, Obama portrayed the election as a referendum on Trump.

“There has never been anyone, man or woman, more qualified for this office. Ever. And that’s the truth. I know Hillary can do the job. That’s why I am so proud, North Carolina, to endorse Hillary Clinton as the next president of the United States,” he said. “You have a clear choice to make between two fundamentally different visions of where America should go.”

Clinton is hoping that a combination of fear of Trump and love for Obama in places like Charlotte can carry her to a big win in November. Obama and Clinton were originally scheduled to campaign together for the first time on June 15 in Wisconsin, but that appearance was postponed after the massacre in Orlando. By the time they rescheduled, as my colleague Russell Berman reported, bad polling and lack of organization for Trump in the upper Midwest had given the Clinton campaign the confidence to shift its focus to North Carolina, a reddish-purple state it believes is now in play.

Obama won the Old North State narrowly in 2008, on the strength of high turnout among African American voters and in urban centers. Since then, the state has only become more polarized between cities and rural areas, with battles over voting laws, government spending, guns, education, and—most recently—transgender rights, around HB2, the controversial “bathroom bill.” Republicans upgraded their own political organization following the 2008 loss, capturing the state legislature, the governorship, and a U.S. Senate seat. In 2012, Mitt Romney edged Obama in North Carolina. For Clinton to recapture Obama’s 2008 magic—and avoid his fate in 2012—she will need to motivate the state’s black and city-dwelling voters, and hope Republicans don’t turn out. For the first part, she’s relying on Obama. And for the second, she’s relying on Trump.

Just like Bill Clinton’s 2012 speech at the Democratic National Convention, where the elder statesman practically overshadowed the president, Obama’s performance was almost too good, showing the natural charisma that helped him beat Hillary Clinton in 2008. (Obama even emulated the Big Dog’s legendary long-windedness. Near the end of his remarks, Obama fauxpologized for going on so long: “When you haven’t campaigned in a while, you start enjoying it too much.”) He joked with the crowd about his love of North Carolina and especially its cuisine. Hillary Clinton wisely chose to speak first, letting Obama close things out, though she got her punch lines in, too. Praising Obama for never forgetting where he came from, she added, “And Donald, if you’re out there tweeting: It’s Hawaii.”

Clinton is touting an economic plan—including a major jobs program, debt-free college, fighting offshoring, and taxing the wealthy—and the president took that cue, focusing on the economic case for a Clinton presidency. “She’s actually got a plan. It’s actually paid for! You can actually look at it,” he said. “This isn’t even a choice, because the other side’s got nothing to offer you.” As he has done before, Obama mocked Trump as nothing but a television star. “This is not a reality show. This is reality,” he said. “When a crisis hits, you can’t just walk of the set. You can’t fire the scriptwriter.” While helping Clinton, he took the opportunity to help himself, criticizing Republicans for blocking his agenda and for refusing to hold confirmation hearings for Merrick Garland, his nominee for the Supreme Court.

If Clinton is wary of being tied too closely to Obama, there was little sign of that in her remarks, as she praised his family, leadership, judgment, and track record. “Actually, I don’t think he gets the credit he deserves for saving our economy,” she said, ticking off a litany of benchmarks: “I could go on and on but you get the idea.” She framed her role not as a third Obama term, but as using his legacy as a base. “Our next president has a different job to do: building on the progress that President Obama has made,” Clinton said.

It would have been easy for her to get carried away with the love for Obama in the crowd. The president won North Carolina narrowly in 2008, buoyed by strong support from African Americans and city dwellers in urban centers like Charlotte. Pauline Semuel, a distinguished black woman, came to the rally wearing a dress she’d had made out of five Obama t-shirts, each in different colors. She’d missed a chance to see Obama speak at the University of North Carolina at Charlotte, where she was working at the time, and was determined not to miss him again.

“I’m very excited about the history that’s being made here,” she told me. “I’m excited the President Obama and Hillary Clinton are coming together, a black man and a white woman. They can’t talk about prejudice. Let’s talk about love.”

Leonard Williams, another Charlotte resident, was more direct about the historical resonance of the two politicians. “I’m here to join the celebration,” he said. “It’s like a red moon.”

If the shots at Trump were clear and pointed, Clinton and especially Obama had a pointed, if slightly more subtle, message for the other candidate in the race, Senator Bernie Sanders, and to his supporters: Fall into line. Recalling her rivalry with Obama in 2008, Clinton said, “When it was over, I was proud to endorse him and campaign for him,” emphasizing the syllables.

Obama made the case for party unity in the face of a Trump candidacy at greater length. “At the end of our contest, I saw the grace and the energy with which she threw herself into my campaign,” he said. “Not because she wasn’t disappointed by the outcome of the primary, but because she knew there was something at stake that was bigger than either of us, and that was the direction of the country. We may have gone toe to toe from coast to coast, but we stood shoulder to shoulder for the ideals we shared.”

Neither Obama nor Clinton mentioned FBI Director James Comey’s press conference earlier Tuesday, in which he announced that he was recommending that Clinton not be charged with any crime for her use of a private email server, yet also starkly criticized her judgment in using the system. But Clinton, like Obama, seemed in high spirits.

The event brought Clinton back to North Carolina for the second time in two weeks. On June 22, she held a rally at the state fairgrounds in Raleigh. Two recent polls, from CBS News and the conservative, North Carolina-based Civitas Institute, show Clinton with a small lead over Trump. A third, from Democratic-affiliated firm Public Policy Polling, showed Trump up narrowly.

North Carolina features two tight down-ballot races this year, and Clinton’s performance here could spell the difference in the races for governor and U.S. Senate. State Attorney General Roy Cooper, who is running against Governor Pat McCrory, and Deborah Ross, who is running against Senator Richard Burr, both appeared at the rally, having skipped her appearance in Raleigh. (It turns out the president isn’t just a big draw for voters—he can help with turnout among office seekers, too.) After Clinton and Obama announced their rally, Trump scheduled a rally for Tuesday evening in Raleigh, halfway across the state. He, too, has been a somewhat frequent visitor, campaigning in Greensboro in mid-June. But neither McCrory nor Burr attended Trump’s Raleigh event, which was most notable for the candidate’s remarks about Saddam Hussein. Though both men have endorsed him, somewhat tepidly, Republicans still see him as too unpredictable and potentially damaging to embrace.

The urban-rural divide that explains why North Carolina is in play in this election was on display to the nation in the fight over HB2, the state’s “bathroom law.” The fracas began when Charlotte instituted a local ordinance requiring transgender bathroom accommodation, and Republican state legislators moved to overturn it. Several attendees cited the law as a reason they felt strongly about this year’s race. At the rally on Tuesday, Vara Bell of Raleigh, who sported a “Hillary y’all” button, dared to hope that Clinton, Cooper, and Ross could make a clean sweep. “There are a lot of dormant Democrats that are champing at the bit,” she said.

For Democrats, Trump remains the surest fire way to ensure that rank-and-file voters are as fired up and ready to go as the president is, a truth that Obama acknowledged in framing the election as a referendum on the Republican. Monica Mehareb, an 18-year-old Charlotte resident who is voting in her first election, couldn’t even bring herself to speak Trump’s name. Asked why she’d come to the rally, she told me, “Anything to save the future of America from the other candidate running.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.