President Obama takes the stage at a Hillary Clinton campaign event in Charlotte last week. (Jonathan Ernst/Reuters)

In the waning days of a bitter, exhausting, enervating election season, President Obama has often seemed to be the only person in America who is still having fun.

On each of his stops for Democratic presidential nominee Hillary Clinton, he has been greeted by screaming crowds and a palpable nostalgia embodied by the same largely improvised exchange.

“I love you,” a voice from the crowd inevitably calls.

“Love you, too,” Obama always replies.

The exchange captures one of the striking paradoxes of this election season: At a moment defined by anger at Washington, voter cynicism and two historically unpopular presidential candidates, Obama’s approval rating is the highest it has been since his first days in office. It now stands at 56 percent, according to a Gallup tracking poll released Sunday.

Obama was a symbol for healing America’s racial wounds. His legacy will reflect a more complicated story.

For the first time in decades — dating back to Ronald Reagan — a lame-duck incumbent is in high demand on the campaign trail.

The good feelings, meanwhile, extend beyond the president himself. First lady Michelle Obama has been perhaps Clinton’s most effective surrogate, campaigning alongside her in North Carolina last month. In crucial swing states such as Florida and Pennsylvania, Vice President Biden’s popularity surpasses even that of the president at his eight-year peak. Nearly two-thirds of voters in Pennsylvania, for example, have a favorable view of the vice president and the first lady, according to a recent Bloomberg Politics poll.

Some key factors have worked to the president’s advantage. Respectable job growth and declining unemployment have helped the public mood, and for the most part, this White House has not been hobbled by any significant scandals in the second term.

But the biggest reason for the late-term surge in presidential popularity may be the election itself. “I know a lot of you are cynical about politics,” Obama told a crowd in Miami last week. “There’s a lot about this election that gives you reason to be.”

Presidential elections often are, at least in part, a referendum on the incumbent. But for months, Clinton and Republican nominee Donald Trump have been blasting away at each other in what amounts to a contest about character between two highly polarizing figures. Even a recent surge in insurance premiums associated with the Affordable Care Act, Obama’s signature domestic policy accomplishment, has left the president largely unscathed, and broader Republican attacks on him have not been particularly effective.

“We should have been able to say, ‘We’re ready for a change,’ ” Sen. Lamar Alexander (R-Tenn.) said. “That has not been done successfully by the Trump campaign.”

At a rally for Hillary Clinton in Miami on Nov. 2, President Obama said Sen. Marco Rubio's vote for Donald Trump shows that the Florida Republican "will say anything or be anything" to "get elected or cling to power." Obama told voters to elect Rep. Patrick Murphy (D-Fla.) instead. (The Washington Post)

Typically, Obama is Trump’s third or fourth target, behind Clinton, the GOP establishment and the news media.

Last week, as Trump’s plane was taxiing for takeoff in Miami, he spotted Air Force One on the tarmac. “He’s down here campaigning for Crooked Hillary,” Trump said at a rally later that afternoon. “Why isn’t he back in the White House bringing our jobs back? And helping our veterans? Why? Why isn’t he back working?”

Trump, however, has been either unwilling or unable to go after Obama for his handling of foreign affairs, the area where support for the president’s policies is weakest. Since 2012, nearly 400,000 Syrians have died in that country’s civil war, while nearly 5 million have fled as refugees.

Amid that worsening humanitarian catastrophe, the toughest critiques of Obama’s approach have come from Clinton, who has questioned the president’s unwillingness to arm Syrian rebels early in the conflict or establish no-fly zones to protect American allies from Russian and Syrian bombs.

Trump, channeling the electorate’s fatalism regarding the Middle East, has broken with Republican Party orthodoxy and suggested outsourcing the crisis to the Russian and Syrian regime forces.

“Things are not going well in Syria or Iraq,” said Michael Singh, a former top foreign policy official in George W. Bush’s White House. “But there is no heated partisan debate on how to handle it.”

As the rhetoric has grown louder and meaner, Obama also has benefited from a White House message machine built, over the past eight years, for the digital age. Both the president and the first lady have been in heavy rotation on the TV talk-show circuit. Michelle Obama’s “Carpool Karaoke” appearance with “Late Late Show” host James Corden has garnered more than 46 million views since it first aired in July — an audience that dwarfs any for campaign advertising in the current election cycle.

The president, meanwhile, has gone from being a relative newcomer to national politics when he won in 2008 to a more practiced and confident politician.

“I know what I’m doing, and I’m fearless,” Obama said in a podcast interview last year.

Jennifer Psaki, the White House communications director and a longtime Obama aide, recently made a similar point in an interview: “What people are seeing is that he feels liberated, and he’s able to be the wonky, optimistic, slightly nerdy president that people elected.”

In the final months of his presidency, Obama has played on that public nostalgia, returning repeatedly to the broader themes of the 2004 Democratic National Convention speech that made him a political star and his 2008 inaugural address. “I’m asking you the same thing I asked of you eight years ago,” he said in Miami. “I’m asking you to believe — not in my ability to change things or one person’s ability change things . . . I’m asking you to believe in your ability to change things.”

Obama’s campaign audiences are often full of young, college-age voters, many of whom were in elementary school when he was elected. The message, however, is the same Obama message. “You can draw a straight line between that speech in 2004 and the speeches” he is giving on the campaign trail, said David Simas, White House political director.

The question is whether that loyalty and good feeling will transfer to Clinton.

Obama spent the hours leading up to Election Day trying to rally the vote in swing states where support for Clinton, particularly among young people and African Americans, looks shaky.

Several of the president’s former campaign aides have started sharing their own video, titled “Do It for Obama,” in which they recount war stories and explain why Clinton deserves support.

Liz Jaff, who worked on both of Obama’s presidential campaigns and helped create the video, has spent more than a week turning out voters in Ohio. As she walked around a parking lot in Columbus near Clinton’s campaign office, she worried that a Trump victory would essentially be a repudiation of Obama’s presidency.

“If we elected the first African American president and it just opened up more racism in our society, it’s just really hard,” she said, her voice cracking as she started to cry.

“We did everything for him,” she said. “It should be the same for her.”

Jenna Johnson contributed to this report.