The shooting broke out at 12:20 p.m. as mourners were filing out of the Cosmopolitan Baptist Church in East Oakland. Witnesses say things quickly got out of control.
"I ducked and I ran; that's all I could do," one woman said.
The gunfire and ensuing fight prompted a large police response.
"Officers arrived on scene and they located several people outside engaged in a fight and several of those people were armed with firearms; officers called a city-wide emergency," Oakland Police Department spokesperson Holly Joshi said.
All available officers in the city responded to the 85th Avenue and E Street location.
The funeral service was being held for 18-year-old Devante Riley, who died in an apparent accidental shooting at a party on April 18. Hundreds of people attended Tuesday's funeral service.
Emotions ran high as some of the crowd began to confront police officers. Surprisingly, given the number of people and the number of weapons, no one was shot, although several people were taken to the hospital. Five people were arrested.
Police say they have no reason to believe the incident was gang-related, but are continuing to investigate possible motives and targets.