Conceding disappointments during his presidency yet offering vigorous encouragement for the nation's future, Barack Obama issued an emotional defence Tuesday night of his vision to Americans facing a moment of anxiety and a dramatic change in leadership.

Obama's valedictory speech before an estimated 18,000 in his hometown of Chicago was a public meditation on the trials and triumphs, promises kept and promises broken that made up his eight years in the White House. 

"Yes, our progress has been uneven," Obama said. "The work of democracy has always been hard, contentious and sometimes bloody. For every two steps forward, it often feels we take one step back."

Yet Obama argued his faith in America had only been strengthened by what he's witnessed the past eight years, and he declared: "The future should be ours."

Obama on threats to democracy2:41

The former community organizer closed out his speech by reviving his 2008 campaign chant, "Yes we can." To that, he added for the first time, "Yes we did."

Reflecting on the corrosive recent political campaign, he said, "That potential will be realized only if our democracy works. Only if our politics reflects the decency of our people. Only if all of us, regardless of our party affiliation or particular interest, help restore the sense of common purpose that we so badly need right now."

Teary tribute to family

Brushing away tears with a handkerchief, Obama received some of his greatest applause for his tribute to the sacrifices made by his wife — and by his daughters, Malia and Sasha, who were young girls when they entered the big white home on Pennsylvania Avenue and leave as young women. He praised his wife Michelle Obama for taking on her role "with grace and grit and with style and good humour" and for making the White House "a place that belongs to everybody."

Obama on his family3:37

He made no mention of Republican Donald Trump, who will replace him in just 10 days. But when he noted the imminence of that change and the crowd began booing, he responded, "No, no, no, no, no."

One of the nation's great strengths, he said, "is the peaceful transfer of power from one president to the next."

Earlier, as the crowd of thousands chanted, "Four more years," he simply smiled and said, "I can't do that."

Still, Obama offered what seemed like a point-by-point rebuttal of Trump's vision for America.

He pushed back on the isolationist sentiments inherent in Trump's trade policies. He decried discrimination against Muslim Americans and lamented politicians who question climate change. And he warned about the pernicious threat to U.S. democracy posed by purposely deceptive fake "news" and a growing tendency of Americans to listen only to information that confirms what they already believe.

Obama on fake news, compromise2:34

Get out of your "bubbles," said the politician who rose to a prominence with a message of unity, challenging divisions of red states and blue states. Obama also revived a call to activism that marked his first presidential campaign, telling Americans to stay engaged in politics.

"If you're tired of arguing with strangers on the internet," Obama said pointedly, "try to talk with one in real life. "

Soon Obama and his family will exit the national stage, to be replaced by Trump, a man Obama had stridently argued poses a dire threat to the nation's future. His near-apocalyptic warnings throughout the campaign have cast a continuing shadow over his post-election efforts to reassure Americans anxious about the future.

Defends health care, immigration ideas

Indeed, much of what Obama accomplished over the past eight years — from health care overhaul and environmental regulations to his nuclear deal with Iran — could potentially be upended by Trump.

For example, Trump has urged the Republican-controlled Congress to repeal the Affordable Care Act right away.

Michelle Obama/Malia

Michelle Obama and daughter Malia lean into one another as they listen to President Barack Obama speak during his farewell address at McCormick Place in Chicago, on Tuesday. (Pablo Martinez Monsivais/The Associated Press)

"If anyone can put together a plan that is demonstrably better than the improvements we've made to our health care system, that covers as many people at less cost, I will publicly support it," he said in another prodding challenge to his successor.

With Democrats still straining to make sense of their devastating election losses, Obama tried to offer a path forward. He called for empathy for the struggles of all Americans — from minorities, refugees and transgender people to middle-aged white men whose sense of economic security has been upended in recent years.

Paying tribute to his place as America's first black president, Obama acknowledged there were hopes after his 2008 election for a post-racial America.

"Such a vision, however well-intended, was never realistic," Obama said, though he insisted race relations are better now than a few decades ago.

Obama on race relations2:26

Though the coalition of young Americans and minorities who twice got Obama elected wasn't enough to elect Democrat Hillary Clinton to replace him, Obama suggested their day was still ahead.

"You'll soon outnumber any of us, and I believe as a result that the future is in good hands," he said.

Even as Obama said farewell to the nation — in a televised speech of just under an hour — the anxiety felt by many Americans about the future was palpable, and not only in the Chicago convention centre where he stood in front of a giant presidential seal. The political world was reeling from new revelations about an unsubstantiated report that Russia had compromising personal and financial information about Trump.

After returning to Washington, Obama will have less than two weeks before he accompanies Trump in the presidential limousine to the Capitol for the new president's swearing-in. After nearly a decade in the spotlight, Obama will become a private citizen, an elder statesman at 55. He plans to take some time off, write a book and immerse himself in a Democratic redistricting campaign.

Obama thanks the American people0:47

With files from Reuters