Media playback is unsupported on your device Media caption Barack Obama awards the Presidential Medal of Freedom to Ellen DeGeneres

Comedian Ellen DeGeneres was praised by the US president for her influence on the gay rights movement as she received the country's highest civilian honour.

Celebrities including Tom Hanks, Robert De Niro and Michael Jordan were also among the 21 recipients of the Presidential Medal of Freedom.

Barack Obama said it was easy to forget the risk Ellen DeGeneres took to come out as gay in 1997.

He said her bravery helped "push our country in the direction of justice".

"It's easy to forget now, when we've come so far... just how much courage was required for Ellen to come out on the most public of stages almost 20 years ago," he said during the award ceremony at the White House.

"What an incredible burden that was to bear - to risk your career like that - people don't do that very often. And then, to have the hopes of millions on your shoulders."

Read more:

Can Trump outlaw gay marriage?

''I'm gay - but I wasn't 'born this way'

LGBT characters on TV 'at record high'

The award, which recognises contributions to United States culture, security and international interests, is the highest honour a civilian can receive, alongside the Congressional Gold Medal, a similar accolade awarded by the US Congress.

"These are folks who have helped make me who I am,'' Obama said.

"Everybody on this stage has touched me in a very powerful, personal way, in ways that they probably couldn't imagine."

Media playback is unsupported on your device Media caption Barack Obama awards the Presidential Medal of Freedom to some famous faces - and makes a few jokes at their expense

Honourees from the entertainment world included actors Tom Hanks, Robert De Niro, Robert Redford and Cicely Tyson, as well as musicians Bruce Springsteen and Diana Ross.

From the sporting world, former basketball superstars Kareem Abdul-Jabbar and Michael Jordan - who President Obama jokingly referred to as "the guy from Space Jam"- were awarded the medal, alongside sports broadcaster Vin Scully.

Image copyright Getty Images Image caption Singer Diana Ross was among the 21 recipients

Image copyright AP Image caption Bruce Springsteen also received the award

Image copyright Getty Images Image caption There's a reason you call somebody "the Michael Jordan" of their field, said the president

Bill and Melinda Gates were awarded for their philanthropic work through their charitable foundation.

Despite the president's words on the contribution Ellen DeGeneres made to the country, she almost missed the ceremony after security refused to let her in to the White House.

"They haven't let me in to the White House yet because I forgot my ID," she tweeted, alongside a photo of herself sitting on a nearby park bench.

Once inside, however, she took advantage of the assembled icons to film a take on the mannequin challenge.

Other recipients of the Presidential Medal of Freedom were: