The gunman then fled on foot, police said, leading to an intense manhunt by dozens of Oakland police, California Highway Patrol officers and Alameda County sheriff deputies. Streets were roped off and an entire area of east Oakland closed to traffic.
At about 3:30 p.m. officers, acting on an anonymous tip, found the suspect barricaded inside an apartment building, police said.
Police said the gunman fired an assault rifle at officers who came into the building to arrest him. Two members of the SWAT team were killed and a third was grazed by a bullet, police said.
Acting Oakland police Chief Howard Jordan said police returned fire, killing a man they identified as 26-year-old Lovelle Mixon of Oakland.
The slain officers were identified as Sgt. Mark Dunakin, 40, who was killed at the first shooting. The officers killed at the second location were Sgt. Ervin Romans, 43, and Sgt. Daniel Sakai, 35. Officer John Hege, 41, was in grave condition.
Somber officers at the police station hugged and consoled each other.
"This is probably one of the worst incidents that has ever taken place in this history of the Oakland police department," Thomason said.
Gov. Arnold Schwarzenegger said it was a tragic day.
"All four officers dedicated their lives to public safety and selflessly worked to protect the people of Oakland," he said in a statement. "Our thoughts and prayers are with the families of those lost, the Oakland Police Department and law enforcement officers throughout California during this difficult time."
Police said Mixon wielded two different weapons. One gun was used at the first scene and an assault rifle was used at the apartment building where he was hiding.
"(Mixon) was on parole and he had a warrant out for his arrest for violating that parole. And he was on parole for assault with a deadly weapon," said Oakland police Deputy Chief Jeffery Israel.
Police did not say why the officers had initially stopped the suspect, other than to call the stop routine.
People lingered at the scene of the first shooting. About 20 bystanders taunted police.
Tension between police and the community has risen steadily since the fatal shooting of unarmed 22-year-old Oscar Grant by a transit police officer at an Oakland train station on Jan. 1.
That former Bay Area Rapid Transit officer, Johannes Mehserle, has pleaded not guilty to a murder charge. A preliminary hearing is scheduled for Monday. Violent protests erupted on the streets of Oakland in the weeks after Grant's death, further inflaming tensions.
Officer deaths are nothing new in Oakland. The memorial wall in the Oakland Police headquarters shows that at least 47 officers died before Saturday. The wall shows the last officer killed in Oakland was in January of 1999.
People left four bouquets of white roses under the granite wall inside the building lobby.
The governor's office said Schwarzenegger would fly to Oakland on Sunday from Washington, D.C., to meet with police and Mayor Ron Dellums to "get a firsthand account of what's happening." Both state Attorney General Jerry Brown and Dellums were at Saturday's news conference.
A group of Oakland ministers went to the hospital to offer prayers and condolences to the family members of the injured officers and the dozens of Oakland police officers who gathered there.
They said that on Sunday morning they would urge their parishioners not to let the event tear the city apart.
Pastor Raymond Lankford, executive director of Healthy Oakland, urged people to show support for the officers and their families.
"What officers do, that's a tough job," Lankford said. "They need love, they need support. They need to know the community is behind them."
MORE L.A. BREAKING NEWS, WEATHER, TRAFFIC, SPORTS
SEND TIP || REPORT TYPO || TWEET @abc7 || WIDGET