As the president looked on with first lady Michelle Obama, McCartney performed many of the hits he had with the Beatles and as a solo artist, including "Got to Get You Into My Life," "Eleanor Rigby" and "Michelle" -- a song he said he'd been "itching to do at the White House." He closed the show by singing "Let It Be' and getting everyone in the East Room of the White House to sing along with the familiar "Na, na, na, na, na, na, na" chorus on "Hey Jude."
The program featured Faith Hill singing "The Long and Winding Road," Elvis Costello singing "Penny Lane," Stevie Wonder performing "We Can Work It Out" and Corinne Bailey Rae singing "Blackbird."
During his remarks, Obama talked about the "difficult time" the Gulf Coast is going through because of the Gulf of Mexico oil spill, noting that music and "(p)art of what gets us through tough times."
McCartney said getting the Gershwin Prize "is good enough," but he was especially pleased to receive it "from this president."
"You have billions of us who are rooting for you and we know you're going to come through," he told Obama.
Obama presented the Gershwin Prize last year to Stevie Wonder. The initial Gershwin Prize was presented to Paul Simon.
Wednesday's concert is to be broadcast on PBS stations July 28 as "In Performance at the White House Celebrating the Music of Paul McCartney: The Library of Congress Gershwin Prize."
The award commemorates George and Ira Gershwin, the famous U.S. songwriting team whose extensive manuscript collections are kept in the Library of Congress.