NEW YORK -- Music and comedy royalty struck a defiant tone in a benefit concert for Hurricane Sandy that started Wednesday and stretched into Thursday morning with a rousing set by Sir Paul McCartney, asking for help to rebuild a New York metropolitan area most of them know well.

Alicia Keys closed the nearly six-hour show at 1:15 a.m. with “Empire State of Mind,” this century’s most indelible song about her hometown.

The sold-out Madison Square Garden show was televised, streamed online and aired on radio all over the world. Producers said up to 2 billion people could experience the concert live.

“When are you going to learn,” comic and New Jersey native Jon Stewart said. “You can throw anything at us — terrorists, hurricanes. You can take away our giant sodas. It doesn’t matter. We’re coming back stronger every time.”

Jersey Shore hero Bruce Springsteen set a roaring tone, opening the concert with “Land of Hope and Dreams” and “Wrecking Ball.” He addressed the rebuilding process in introducing his song “My City of Ruins,” noting it was written about the decline of Asbury Park, N.J., before that city’s renaissance over the past decade. What made the Jersey Shore special was its inclusiveness, a place where people of all incomes and backgrounds could find a place, he said.

“I pray that that characteristic remains along the Jersey Shore because that’s what makes it special,” Springsteen said.

He mixed a verse of Tom Waits’ “Jersey Girl” into the song before calling New Jersey neighbor Jon Bon Jovi to join him in a rousing “Born to Run.” Springsteen later returned the favor by joining Bon Jovi on “Who Says You Can’t Go Home.” 

Adam Sandler harked back to his “Saturday Night Live” days with a ribald rewrite of the oft-sung “Hallelujah” that composer Leonard Cohen never would have dreamed. The rewritten chorus says, “Sandy, screw ya, we’ll get through ya, because we’re New Yawkers.”

Chris Rock, who last month performed at the St. George Theatre with fellow comedian Louis C.K. to raise funds for hurricane relief, provided the narrative for a stricken Staten Island and gave a shout out to Oakwood Beach resident Phyllis Puglia, who lost everything in the superstorm.

On a lighter note, Rock joked that they were going to raise so much money Wednesday night that “Jersey’s fixed. Staten Island’s fixed. It looks like Beverly Hills now!”

The music lineup was heavily weighted toward classic rock, which has the type of fans able to afford a show for which ticket prices ranged from $150 to $2,500. Even with those prices, people with tickets had been offering them for more on broker sites such as StubHub, an attempt at profiteering that producers fumed was “despicable.” 

“This has got to be the largest collection of old English musicians ever assembled in Madison Square Garden,” Rolling Stones rocker Mick Jagger said. “If it rains in London, you’ve got to come and help us.”

In fighting trim for a series of 50th-anniversary concerts in the New York area, the Stones ripped through “You’ve Got Me Rockin” and “Jumping Jack Flash” before beating a quick retreat — perhaps not to upstage their own upcoming Pay-Per-View show. Actor Steve Buscemi later made light of that, saying producers made room for him by cutting the Stones short. “I said, ‘if they play more than two songs, I’m out of here.’”

Jagger wasn’t in New York City for Sandy, but he said in an interview before the concert that his apartment was flooded with 2 feet of water.

The Who wove Sandy into their set, showing pictures of storm devastation on video screens during “Pinball Wizard.” Pete Townshend made a quick revision to the lyrics of “Baba O’Riley,” changing “teenage wasteland” to “Sandy wasteland.”

Appearing earlier in the evening, Ms. Keys asked the audience to hold their cell phones high for her song “No One,” triggering a sea of light that is the modern version of an earlier generation’s holding cigarette lighters in the air. “We love you,” Keys said, “and we’ll make it through this.”

Billy Joel also did his signature “New York State of Mind.” Joel’s “Miami 2017 (Seen the Lights Go Out on Broadway)” sounded prescient, with new Sandy-fueled lyrics smoothly fitting in.

By the time Joel worked in “Have Yourself a Merry Little Christmas,” the concert was already testing the patience of viewers. Long sets by The Who and Kanye West stretched beyond the point of endurance, and Seth Meyers’ “drunk uncle” comedy set fell flat.

An energetic West worked up a sweat in a hoodie, black leather pants and a black skirt. He told the audience that he had friends displaced by Sandy who were staying at his house, before getting the crowd swaying with a version of “Gold Digger.” He ended his set by shouting, “I need you right now!” tossing his microphone and stalking off stage.

Besides the Garden, people gathered in theaters across the region and country to watch the show. In Toms River, N.J., mail carrier Jerry Frasco said he was in awe of a lineup that included many of his favorites from 40 years ago.

“We didn’t want to go through a hurricane to have it,” he said.

Eric Clapton switched from acoustic to electric guitar and sang “Nobody Knows You When You’re Down and Out” and “Crossroads.” New York was a backdrop for Clapton’s personal tragedy, when his young son died after falling out of a window.

Roger Waters played a set of Pink Floyd’s spacey rock, joined by Eddie Vedder for “Comfortably Numb.” Waters stuck to the music and left the fundraising to others.

“Can’t chat,” he said, “because we only have 30 minutes.” 

The sold-out “12-12-12” concert was being shown on 37 television stations in the U.S. and more than 200 others worldwide. It was to be streamed on 30 websites, including YouTube and Yahoo, and played on radio stations. Theaters, including 27 in the New York region and dozens more elsewhere, were showing it live.

Proceeds from the show will be distributed through the Robin Hood Foundation. More than $30 million was raised through ticket sales alone.

Many of the artists told personal stories of friends or family affected by the storm, like Richie Sambora of Bon Jovi.

The concert came a day after the death of sitar master Ravi Shankar, a performer at the 1971 “Concert for Bangladesh,” considered the grandfather of music benefits. That concert also was in Madison Square Garden.