The dress code was purple, and the only requirement was to party. Hundreds of people obliged Saturday as Spike Lee threw a huge outdoor party for Prince ahead of the late legend's 58th birthday.

Al Sharpton, Rosie Perez, former Prince associates and others joined the crowd in paying tribute to the late superstar, whose birthday is Tuesday.

Prince died April 21, and an autopsy revealed this week that he had died of an accidental overdose of fentanyl, a powerful opioid painkiller. But the focus Saturday was on Prince's life and music, not his death.

For six hours, fans of all ages jammed to hits like "When Doves Cry," ''Starfish and Coffee," ''Erotic City" and more under the hot sun. Some dressed as their idol, while others wore T-shirts that bore his likeness; others donned purple hair, while one woman had his famous symbol shaved on the back of her head.

"Y'all came to celebrate Prince today? Will you celebrate him tomorrow? Will you celebrate him next week? Will you celebrate him next year? Will you celebrate him the rest of your life?" TV host Sway Calloway asked the crowd, to cheers.

Spike Lee entered the party holding a gold Prince symbol, followed by a troupe of kid drummers, all wearing purple. Lee took turns with Sway as emcee of the event.

Sharpton and others also acknowledged the loss of another icon, Muhammad Ali, who died early Saturday morning.

"As one who knew him for many years, I told Spike maybe he left 'cause he heard there was a jam session," Sharpton said. "And Prince has heated up the band on the other side. And somewhere I see Ali waving his hands saying 'Purple Rain, Purple Rain." They're having a big jam session."

Musician Andre Cymone, who played with Prince and knew him since childhood, said he was still mourning.

"I'm still in shock. A beautiful brother, and I'm lost. I can't even put it into words," he told the crowd.

Perez, basketball great Earl "The Pearl" Monroe and John Salley also spoke at the event.

Lee held an impromptu dance party in Brooklyn after the singer died on April 21. He also held a similar celebration honoring Michael Jackson in the years since his 2009 death.

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)

More From New Jersey 101.5 FM