With stacks of amps behind him and the leader of the free world just two feet in front, Paul McCartney brought rock & roll to the East Room of the White House last night as he collected the Library of Congress' Gershwin Prize for Popular Song, an award that acknowledged his contributions to the American songbook. (McCartney is the first person who is not American to receive the award.) Joined by a diverse group of musicians from Elvis Costello to the Jonas Brothers, the mood was mostly playful and the assembled musical guests performed stirring versions of songs from the Beatle's decades-spanning career.

But there were somber moments, too, including remarks from Obama about the BP oil disaster, and some overtly political comments from McCartney, who praised Obama and took some digs at George W. Bush. "Getting this prize would just be good enough, but getting it from this president …," McCartney said. Later, he noted, "After the last eight years, it's great to have a president who knows what a library is." But the evening, after all, was about McCartney, and Obama praised the timelessness and the universal appeal of McCartney's music — and also geeked out with some Beatles statistics: 200 of McCartney's songs have charted, Obama said, and they've stayed there for "a cumulative total of 32 years."

Throughout the evening, the president — sitting with the first family and McCartney's girlfriend, Nancy Shevell — occasionally let down his guard and was visibly transported by the Beatle's music. During McCartney's opening number, "Got to Get You Into My Life," Obama briefly closed his eyes, smiled broadly, and swayed his head sideways. During Stevie Wonder's lean and energetic rendition of "We Can Work It Out," the president and first lady grooved and made eye contact, even as their daughters appeared somewhat stone-faced. Sasha and Malia Obama, however, were more receptive to the next performers: the Jonas Brothers, who turned in a note-perfect, lively version of "Drive My Car."

For every joyous anthem, there was a quiet, pensive number: Emmylou Harris delivered an earthy and reflective "For No One" while Jack White seemed to cover "Mother Nature’s Son" with the Delta blues in mind. Herbie Hancock and Corinne Bailey Rae's "Blackbird" was gentle and unrushed, greatly enhanced by Hancock's prismatic flourishes. Faith Hill's "The Long and Winding Road" treated the meditative ballad like a popular — and not a pop — standard, with muscular backing from McCartney's band.

Elvis Costello's rendition of "Penny Lane" carried some personal meaning for the English singer: "Music is often an us-against-them proposition," Costello said. "The next song you're going to hear is named after a place from which my mother comes from — about half a mile away. So you can imagine when this thing of wonder and beauty came on the radio, myself as a young man, my dad, my mam, and the cat, all stood up and took notice. And I think it's a beautiful way that Paul's songs unite us."

Dave Grohl amped things up a bit with a kinetic and raucous version of Wings' "Band on the Run." For Grohl, a D.C. native, performing at the White House was something of a homecoming. "I have probably played every club and every basement and every arena and every stadium," said Grohl, who drummed in local hardcore band Scream before joining Nirvana. But none of those venues compared to playing the White House. "Paul, you're definitely my hero. Mr. President, you're my other hero." Another highlight of the night included Wonder, a previous recipient of the Gershwin award, joining McCartney for a duet on "Ebony and Ivory." The rendition was enough to get a marine, stationed just outside the East Room, to stand up and gently shimmy.

Jerry Seinfeld brought laughs to the event with a short routine, in which, tongue firmly in cheek, he questioned some of McCartney's lyrical intentions. "Take 'When I Saw Her Standing There,' " Seinfeld said, quoting the famous line: " 'She was just 17/You know what I mean.' I’m not sure I do know what you mean, Sir Paul," Seinfeld said. "I think I know what you mean and I think there's a law enforcement agency in a couple of states in this country that might like you to come downtown and answer a few questions about what you mean."

But the recent news of the BP oil disaster in the Gulf of Mexico weighed heavily on Obama's mind. "Right now, our thoughts and prayers are with friends in the part of the country that is so rich in musical heritage — the Gulf Coast — who are dealing with something simply not seen before," Obama said. "Part of what gets us through tough times is music, the arts. They help us capture that essential kernel of ourself, that part of us that sings even when times are hard."

As the evening wound down, McCartney paid sly tribute to the first lady with an accordion-backed "Michelle" and ended the concert with three of his most enduring songs: "Eleanor Rigby," "Let It Be," and "Hey Jude." For "Jude," he invited his fellow performers and the first family onstage to help lead the room along in its famous na-na-na coda. "I don't think there could be anything more special than playing here," McCartney said. "We're thinking of making it a regular thing."