California - A police shooting that left a man dead led to a violent clash as angry witness threw bottles at officers who responded with tear gas and beanbag rounds to suppress the crowd, authorities said.

The man was shot in front of an apartment complex around 4 p.m. following a foot chase, Anaheim Sgt. Bob Dunn said. He died three hours later at a hospital.

As officers were investigating what happened at the scene, Dunn said an angry group of people began yelling and throwing bottles at them. He said that as officers detained several people, the crowd advanced on officers so they fired tear gas and beanbag rounds at them.

Video captured by a KCAL-TV crew showed a chaotic scene in which officers fired beanbag rounds as some people ducked to the ground while others scattered screaming. A man is seen yelling at an officer even as a weapon is pointed at him; two adults huddled to shield a boy and girl. Meanwhile, a police dog ran into several people sitting on the grass, including a woman and child in a stroller, before biting a man in the arm.

Dunn said the dog somehow got out of a patrol car and was "deployed accidentally."

Dunn said the man shot by police was one of three men who ran away from officers who approached them in an alley. The other two suspects have not been captured.

He would not say why police shot the man, saying that the details are under investigation by the Orange County District Attorney's office.

He said several people were arrested in the melee, but he couldn't immediately provide a figure.