The shooting was reported at 10:42 p.m. at Mike's Sports Bar and Grill, Hayward police spokeswoman Lt. Chris Orrey said.
The bar is located at the corner of Clawiter and Depot roads, west of Interstate Highway 880.
Orrey said a promoter rented the space "under the ruse of a Martin Luther King Jr. celebration and fundraiser," but that the event turned out to be "a large-scale party which had been heavily promoted as a club-style event with hip-hop and rap music."
Orrey said the promoter did not obtain city permits for the event.
After at least two fights broke out inside the bar, the owner of the bar shut down the party, Orrey said. Security then escorted the group out of the bar into the parking lot.
A short time later, shots rang out in the crowded parking lot.
The shooting victim, Deandre Bailey, of Oakland, was taken to Eden Medical Center in Castro Valley where he was pronounced dead.
No suspects are in custody. Police are asking anyone who attended the event or who has information about the shooting to call police or the Crime Stoppers line at (510) 293-7197.
The shooting is Hayward's third homicide of the year. The city had seven homicides in 2009.