The incident started around 2 p.m. Friday when a Buena Park officer on patrol happened to spot a man shooting at a school bus near Orangethorpe and Western avenues.
There were no reports of injuries and police say it appears only a driver and one student were on the bus.
The officer tried to stop the suspect and he fled. Officers chased him over nearby surface streets and then he drove through a locked fence at the Buena Park School district building and hit a vehicle. At that point, he did not surrender and two officers opened fire.
The man was pronounced dead at the scene and a gun was recovered.
"This could've been much worse," said Buena Park PD Capt. Frank Nunes. "Fortunately our officer was at the right place at the right time and intervened and possibly saved someone's life."
The man's name has not been released