Toward the end of the gala, Cosby introduced Obama to loud applause from the performers and the audience. The president strode to the center of the stage and then conducted the performers in the birthday tune. Kennedy stood and delivered a thumbs-up from his balcony, where he was accompanied by first lady Michelle Obama.
The president later met Kennedy in his box as the performers sang "The Best Is Yet to Come."
Caroline Kennedy presented her uncle with her family's Profile in Courage Award, paying tribute to his efforts to reform the U.S. health care system. When reform becomes a reality, Caroline Kennedy said: "We will all have you to thank. ... We love you, Uncle Teddy."
Referring to her short-lived attempt to seek former New York Sen. Hillary Rodham Clinton's Senate seat, Caroline Kennedy joked, "I never thought I'd be in a room with so many senators."
The audience included Massachusetts' other senator, Democrat John Kerry, as well as Senate Majority Leader Harry Reid, House Speaker Nancy Pelosi and Vice President Joe Biden.
The 77-year-old Sen. Kennedy is battling brain cancer. He returned to Washington for a White House health care summit last week from Florida, where he has been continuing his treatment and physical rehabilitation.
Kennedy was diagnosed with a malignant brain tumor after he had a seizure last May.