Authorities say a man was shot and killed after two separate shootouts with South Florida deputies while a police dog took a bullet during one of the shootouts.

The Palm Beach Post reports that 46-year-old Philip O’Shea died Friday evening. Palm Beach County Sheriff Ric Bradshaw says O’Shea had an extensive criminal history and was wanted in Raleigh, North Carolina, in connection with a May 2 motel robbery.

Bradshaw said deputies saw the suspect, and chased the suspect before he crashed the vehicle, CBS affiliate WPEC reports. Gunfire was exchanged between deputies and the suspect was killed.

PBSO K-9 Officer Kasper took a bullet in the gunfire that was meant for his partner, Bradshaw said. K-9 Officer Kasper is in surgery and is expected to survive.