WASHINGTON — President Obama gave the Presidential Medal of Freedom, the nation’s highest civilian honor, to 21 artists, sports figures, scientists and philanthropists on Tuesday in a bravura performance that had the East Wing, stuffed to capacity, laughing and whooping with appreciation.

“Everyone on this stage has touched me in a powerful personal way,” Mr. Obama said at the ceremony’s end. “These are folks who have helped make me who I am and think about my presidency.”

Mr. Obama has given more Presidential Medals of Freedom than any previous president, and the surprising announcement last week that he would induct one last class — he held a similar ceremony two months ago — reflected his obvious joy in lauding his personal heroes, and the awareness that many of them would probably never receive such an honor from his successor. Many of the awardees have praised Democrats or been sharply critical of President-elect Donald J. Trump.

Among the honorees were Robert Redford, Bill and Melinda Gates, Tom Hanks and Diana Ross. When he put the medal around the neck of Michael Jordan, Mr. Obama, an avid basketball fan, beamed like a 10-year-old.