President Barack Obama painted an optimistic picture of America's future in a rousing speech on Wednesday that offered full-hearted support to Hillary Clinton in her campaign to defeat Republican Donald Trump and become the first woman elected U.S. president.

"There has never been a man or woman, not me, not Bill (Clinton) - nobody more qualified than Hillary Clinton to serve as president of the United States," Obama said to cheers at the Democratic National Convention in Philadelphia.

"Tonight, I ask you to do for Hillary Clinton what you did for me. I ask you to carry her the same way you carried me."

RELATED: Obama expected at DNC, White House releases preview of speech

After Obama's speech, Clinton joined him on stage where they hugged, clasped hands and waved to the crowd.

Obama and Clinton were rivals in the hard-fought campaign for the 2008 Democratic nomination. After winning that election to become America's first black president, he appointed her his secretary of state.

Speaking to delegates, Obama offered an alternative to businessman Trump's vision of the United States as being under siege from illegal immigrants, crime and terrorism and losing its way in the world.

“I am more optimistic about the future of America than ever before," Obama said at the Wells Fargo Center.

Clinton made history on Tuesday when she became the first woman to secure the presidential nomination from a major party.

When she formally accepts it on Thursday, she will become the Democratic standard-bearer against Republican nominee Trump in the Nov. 8 election.

Obama took aim at Trump's campaign slogan and promise to "Make America Great Again."

"America is already great. America is already strong. And I promise you, our strength, our greatness, does not depend on Donald Trump," he said.

RELATED: Tim Kaine accepts VP nom, calls Trump 'one man wrecking crew' [WATCH]

"Preach!" members of the crowd shouted. "Best president ever," someone screamed.

Obama listed what he described as a series of advances during his two terms in office, such as recovery from economic recession, the Obamacare healthcare reform and the 2011 killing of al Qaeda leader Osama bin Laden.

Nodding to voters' concerns, Obama said he understood frustrations "with political gridlock, worry about racial divisions" and the slow pace of economic growth.

"There are pockets of America that never recovered from factory closures, men who took pride in hard work and providing for their families who now feel forgotten," Obama said.

Democrats have buttressed Clinton with a star gathering of current and past party notables at this week's convention.

By contrast, many prominent Republicans were absent from the party convention that nominated Trump for the White House last week.

But Trump got a boost in opinion polls from his convention. He had a 2-point lead over Clinton in a Reuters/Ipsos opinion poll released on Tuesday, the first time he has been ahead since early May.

At the convention on Wednesday, U.S. Senator Tim Kaine, Clinton's running mate, described billionaire Trump as "a one-man wrecking crew" who cannot be trusted in the Oval Office.

Frank Burgos and Kimberly M. Aquilina contributed to this report.