A police dog took a bullet for an officer during a shootout that involved a wanted suspect and several South Florida deputies, police said.

The suspect, 46-year-old Philip O’Shea, died Friday evening after a shootout that took place Friday morning. He was wanted for robbing a suburban bar in West Palm Beach, the Palm Beach Post reported.

O’Shea had a warrant out for his arrest in Raleigh, North Carolina, stemming from a motel robbery that took place May 2, according to Palm Beach County Sheriff Ric Bradshaw. He added that O’Shea had multiple warrants for his arrest in North Carolina before he came to Florida.

Deputies spotted the suspect and chased him until he crashed his car, WPEC reported. The suspect allegedly then engaged deputies in a shootout until he was shot and killed.

Bradshaw said a police dog, PBSO K-9 Officer Kasper, took a bullet in the shootout that was meant for another officer. Kasper had surgery Friday night but is expected to recover.