As Donald Trump, the celebrity Republican businessman, moves into the White House, millions of eyes followed his predecessor out the door. Some wept at Democratic politician Barack Obama's departure, while others were only too happy to hold the door for him.

Obama took office during one of the darkest economic periods in America since the Great Depression, as the country fought two devastating wars and faced unending obstruction from the Republican "party of no."

He was beloved and hated by many, as is the destiny of any American president. But even in the very last seconds of his presidency, Obama spread a message of hope:

"I'm still asking you to believe - not in my ability to bring about change, but in yours. I believe in change because I believe in you," he tweeted on Friday. "I won't stop; I'll be right there with you as a citizen, inspired by your voices of truth and justice, good humor, and love."

Here's what we'll remember about the outgoing Obama, the first black president, a cunning politician and a man known for his sense of humour and unending optimism.

https://twitter.com/itzzkait/status/822483147338248197

Health care

The Affordable Care Act, one of Obama's most significant accomplishments, guaranteed health care to millions of uninsured Americans. It's also the legislation Trump has said he is most excited to eliminate and replace – although what will replace it is still unclear.

"I want to thank President Obama from the bottom of my heart, because I would be dead if it weren't for him," a staunch Republican who worked on two of the party's presidential campaigns told Republican congressman Paul Ryan.

Foreign policy

Obama also withdrew most combat troops from Iraq, reduced the number of Americans in Afghanistan and continued the search for Osama bin Laden, eventually authorizing the raid that killed the Al Qaeda leader. He oversaw the negotiation of a nuclear pact with Iran and restored diplomatic relations with Cuba, ending a hostile relationship that had lasted for more than half of the last century.

The Great Recession

Obama took on the presidency in the depths of the one of the most prolonged economic downturns since the late 1930s. His first month in office was one of the worst of the period, with almost 600,000 jobs lost in January 2009. But despite Republican claims to the contrary, by the end of his final term, was touted by The Washington Post as a "great president" for job creation.

Climate change

Days before the inauguration of President Trump, who has described climate change as a hoax "created by and for the Chinese," Obama announced that the U.S. would contribute US $500 million to the United Nations' Green Climate Fund, established to help developing countries cope with the effects of climate change.

He invested billions of dollars in green energy development and spearheaded legislation increasing efficiency standards on cars and trucks. Many other substantial changes were frustrated by Republican lawmakers, but during Obama's two terms, carbon emissions in the U.S. declined by nine per cent.

https://twitter.com/angelafritz/status/822492602113159169

LGBTQ rights

Obama publicly maintained during his first presidential campaign that he wasn't in favour of same-sex marriage, but by the end of his two terms he had become one of the strongest supporters of LGBTQ rights to hold the office. He spoke passionately about the rights of LGBTQ Americans, saying on the day the Supreme Court ruled in favour of marriage equality that "We have made our union a little more perfect."

He ended the controversial Don't Ask, Don't Tell military policy, endorsed same-sex marriage and pushed federal agencies to grant their employees' same-sex partners benefits they had until then been denied. In contrast, the LGBTQ page from the White House and the labour department were removed right after Trump's inauguration ceremony.

Michelle Obama, the First Lady

Michelle Obama, a Princeton and Harvard-educated lawyer, played a prominent role and won popularity. She campaigned for marriage equality, took on America's widespread obesity problem. She moved many at the 2016 Democratic National Convention to tears as she spoke about the generations of African Americans who fought tirelessly for equality: "Today I wake up every morning in a house that was built by slaves and I watch my daughters, two beautiful, intelligent black young women, playing with their dogs on the White House lawn."

A magnificent orator

Obama was a president who clearly thought deeply and spoke passionately about the issues facing the country.

In Selma, Alabama, 50 years after marchers faced police batons and dogs to demand the right to vote, he spoke about continuing the struggle against racism in America. "We know the march is not yet over; we know the race is not yet won," he declared. "We know reaching that blessed destination where we are judged by the content of our character requires admitting as much.”

The struggle in Selma, he said, represented "the manifestation of a creed written into our founding documents: ‘We the People…in order to form a more perfect union.'"

"We just need to open our eyes and our ears and our hearts to know that this nation’s racial history still casts its long shadow upon us," Obama said in Selma, Alabama in March 2015.