It happened Sunday just after 6 pm as Dinuba police chased a man wanted in connection to a burglary in the city.
Investigators said the suspect crashed his motorcycle at the roundabout on Buttonwillow and Dinuba Avenues in Reedley.
Moments later, he carjacked someone driving a white four-door car, officials said.
Reedley police responded to both the crash and carjacking.
Officers found the suspect in the stolen vehicle a few minutes later at Englehart and Floral Avenues in Tulare County.
Officials said the suspect got out of the car and tried to run away. Officers tried to stop him with their tasers but missed.
That's when the suspect fired shots at two officers, who then returned fire.
After firing at the officers, the suspect got inside a Reedley police vehicle.
Radio traffic between the officers and dispatch captured the incident as it unfolded, "Hey, he's taking the unit! In my vehicle! He has a gun! He has a gun! Hey, shots fired! Shots fired!"
Authorities tried to order the man to get out of the patrol car.
Investigators said they noticed the man was unresponsive inside. When they approached the vehicle, they found the suspect dead.
A gun was also recovered at the scene.
The two officers involved in the shooting have been placed on administrative leave.
Police have not identified the suspect.