PHILADELPHIA — In an election season in which restive voters of all stripes are frustrated with the status quo, it fell to President Barack Obama on Wednesday to argue for staying the course by giving Democrats a third term in the White House – and that Hillary Clinton is the right person to keep moving the nation forward.

“There has never been a man or a woman more qualified than Hillary Clinton to serve as president of the United States of America,” Obama said about the onetime rival who became his secretary of state and whose election would burnish his legacy.

On Wednesday, the Democratic National Convention also formally nominated Sen. Tim Kaine (Virginia) as its vice-presidential pick. Noting that his eldest child is a Marine who deployed to Europe on Monday, Kaine said: “I trust Hillary Clinton with our son’s life.”

It was the first night in which the Democratic speakers focused heavily on the themes of national security and foreign policy – and their most concerted effort to undermine Republican nominee Donald Trump on issues where he has relentlessly pummeled Obama and Clinton.

Vice President Joe Biden described Trump as “a man who confuses bluster with strength,” and someone who “doesn’t have a clue about the middle class.”

A president of resurgent popularity, Obama offered a counterpoint to the near-apocalyptic portrait of the country on display during last week’s Republican National Convention in Cleveland, where Trump accepted the GOP presidential nomination.

“The America I know is full of courage and optimism and ingenuity. The America I know is decent and generous,” the president said.

He nodded toward the country’s worries and the trauma of recent tragedies.

“We’ve still got more work to do,” the president said. “More work to do for every American still in need of a good job or a raise, paid leave or a decent retirement; for every child who needs a sturdier ladder out of poverty or a world-class education; for everyone who hasn’t yet felt the progress of these past seven-and-a-half years. We need to keep making our streets safer and our criminal justice system fairer; our homeland more secure, and our world more peaceful and sustainable for the next generation. We’re not done perfecting our union or living up to our founding creed – that all of us are created equal and free in the eyes of God.”

But Obama, echoing some of the upbeat themes that first lady Michelle Obama sounded on the convention’s opening night, gave an address focused on progress, both economic and social, and “a younger generation full of energy and new ideas, unconstrained by what is, and ready to seize what ought to be.”

All of it amounted to a reversal of the two parties’ traditional orientations. Republicans typically claim the upbeat mantra of Ronald Reagan, who famously talked of the United States as a “shining city upon a hill,” echoing the words of Puritan John Winthrop’s famous 1630 sermon, which paraphrased Jesus’s Sermon on the Mount.

The Democrats, on the other hand, often have come across as the party more focused on the nation’s woes and flaws – or as then-U.N. Ambassador Jeane Kirkpatrick put it contemptuously at the 1984 GOP convention, the “blame America first crowd.”

Midway through Wednesday evening’s speeches, Tony Fratto, a deputy press secretary in the George W. Bush White House, tweeted: “Watching Democrats talk about America the way Republican candidates used to talk about America.”

For any party to hold the White House for three consecutive terms is a difficult feat, even in rosy times.

Democrats have not done so since before World War II, and only twice since 1828, at the dawn of the modern two-party system. The GOP has done it four times, most recently when Vice President George H.W. Bush won the 1988 election to succeed Reagan.

But it is all the more of a challenge when the vast majority of voters think the country is headed in the wrong direction.

The latest Real Clear Politics average of polls shows that the share of Americans who think the country is on the wrong track is nearly 46 percentage points greater than those who think it is on a favorable course.

That has fueled the anti-establishment mood that delivered the GOP nomination to Trump and made Sen. Bernie Sanders (Vermont) a formidable challenger to Clinton for the Democratic nomination.

There were also scattered anti-”TPP” signs around the area, signaling opposition to the Trans-Pacific Partnership, a pending trade deal championed by Obama but opposed by most congressional Democrats and labor unions. Kaine has supported the deal in the past but is expected to modify his position to conform with that of Clinton, who as secretary of state called it the “gold standard” of trade deals but is now opposed.

Speeches and videos Wednesday aimed to reinforce Clinton’s governing credentials, particularly on national security. This followed Democrats’ efforts to unify the party on Monday and both humanize and attest to their nominee’s character on Tuesday.

Meanwhile, Democrats were given fresh fodder Wednesday for their argument that Trump is unprepared and temperamentally unsuited to be commander in chief.

At a news conference in Florida, Trump pleaded directly with the Russian government to meddle in the U.S. presidential election by finding and releasing tens of thousands of private emails from Clinton – a development that alarmed not only Democrats but also many Republican leaders and foreign policy experts.

Among those called upon to draw contrasts between Clinton’s and Trump’s foreign policy credentials was retired Rear Adm. John Hutson, one of several military leaders in the spotlight at the convention.

“Donald Trump calls himself the ‘law-and-order candidate,’ but he’ll violate international law,” Hutson said. “In his words, he endorses torture ‘at a minimum.’ He’ll order our troops to commit war crimes like killing civilians. . . . This morning, he personally invited Russia to hack us. That’s not law and order. That’s criminal intent.”

Members of the Congressional Black Caucus on Wednesday looked past the Obama era and expressed their faith in Clinton as their standard-bearer and champion. But mostly they delivered a vehement denunciation of Trump, saying he has no plan to lift African Americans.

Rep. Hakeem Jeffries (New York) said Trump is simply “the least-qualified person to ever seek the presidency.” He added a bit of wordplay, saying Clinton had served as secretary of state while Trump is a “secretary of hate.”

In his remarks to the convention, Senate Minority Leader Harry Reid (Nevada) chided Trump as “a hateful con man” but also blamed his Republican counterpart, Senate Majority Leader Mitch McConnell (Kentucky), for “setting the stage” for Trump.

New York Mayor Michael Bloomberg, a onetime Republican turned independent, also urged a vote for Clinton, making a special appeal to his fellow independents.

“The bottom line is: Trump is a risky, reckless and radical choice, and we can’t afford to make that choice,” Bloomberg said.

“There are times when I disagree with Hillary,” he added. “But let me tell you, whatever our disagreements may be, I’ve come here to say: We must put them aside for the good of our country. And we must unite around the candidate who can defeat a dangerous demagogue.”

The former New York mayor is also a leading voice for tougher gun laws, a cause that was featured in a segment of Wednesday night’s program. It included an emotional speech by Christine Leinonen, the mother of Christopher Leinonen, who was killed in the massacre last month at an Orlando, Florida, nightclub.

The presentation also featured speakers with connections to the shootings at Sandy Hook Elementary School in Newtown, Connecticut, in 2012 and at a church in Charleston, South Carolina, last year.

Former congresswoman Gabrielle Giffords (Arizona), who was shot in Tucson in 2011, also appeared alongside her husband, Mark Kelly, a retired astronaut and Navy captain. The two have made it their mission to enact additional gun control measures.

“We have important work ahead of us, work that will determine the future of our country,” said Giffords, who argued for Clinton’s candidacy, saying, “Strong women get things done.”

Former Maryland governor Martin O’Malley, who dropped out of the Democratic presidential race after a dismal showing in the Iowa caucuses, noted that he had competed against Clinton and worked with Kaine when the vice-presidential nominee was governor of Virginia.

“I am here to tell you that Hillary Clinton and Tim Kaine are as tough as they come,” O’Malley said. “They never give up. They never give in.”

O’Malley took aim at Trump, saying he has been “a bully his whole life.”

Kaine’s pick as Clinton’s running mate drew praise from many quarters, but the former Virginia governor faces a challenge in convincing some liberal groups that he will champion their issues. Longtime watchers of Virginia politics say the question during much of Kaine’s career there has been whether he is too liberal for the state.

“I think progressives are looking for him not only to talk about progressive issues, but to talk about them with authenticity and sincerity,” said Stephanie Taylor, co-founder of the Progressive Change Campaign Committee, which bills itself as representative of the “Warren wing” of the Democratic Party, a reference to Sen. Elizabeth Warren (Massachusetts).

“He has a real chance to introduce himself to the Democratic Party and electorate at large,” Taylor said of Kaine.

Some Sanders supporters had threatened in recent days to walk out of the hall or otherwise show their displeasure with Clinton’s pick of Kaine, a former Richmond, Virginia, mayor, Virginia governor and chairman of the Democratic National Committee. Only a smattering of disapproval could be heard in the hall.

In his address to the convention, Kaine showed that he is warming up to the running mate’s traditional role as the presidential nominee’s attack dog.

He delighted the crowd with his mocking impersonation of Trump, focusing on the GOP nominee’s verbal tic of saying “Believe me.”

“Folks, you cannot believe one word that comes out of Donald Trump’s mouth. Not one word,” Kaine said, setting off the delegates in a chant of “Not one word.”

– – –

The Washington Post’s Isaac Stanley-Becker contributed to this report.