Update: Casper is recovering well after surgery and was released on Saturday. The Palm Beach County Sheriff's Office released a new video showing him heading home.

JUPITER, Fla. -- 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.

Get Breaking News Delivered to Your Inbox

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 Casper took a bullet in the gunfire that was meant for his partner, Bradshaw said. K-9 Officer Casper is in surgery and is expected to survive.

Authorities say O'Shea was involved in a shootout Friday morning in suburban West Palm Beach where one deputy was injured while diving for cover. Bradshaw said O'Shea had many outstanding out-of-state warrants in North Carolina prior to coming to Florida.

State law enforcement agents will investigate the shooting.