A San Bernardino County Sheriff’s Department K9 was rescued after a patrol vehicle caught fire during a pursuit of a stolen vehicle suspect Thursday afternoon.

The incident unfolded around 1:40 p.m., when a deputy spotted a Kia that had been reported stolen earlier that day.

Deputy R. Polar tried to stop the driver, but instead, were led on a high-speed pursuit through Victorville, authorities said.

The driver, 22-year-old Adam Mugica, allegedly drove in opposing lanes and caused a non-injury crash.

The deputy tried to stop the Kia again, but Mugica allegedly drove the stolen car into Polar’s patrol vehicle and sped away.

Another deputy then tried a PIT maneuver on the driver, but Mugica kept going.

“The pursuit came to an end when Mugica high-centered the vehicle on a dirt berm in the desert near the intersection of Blue Canyon Road and Seneca Road, and Mugica refused to exit the vehicle,” officials detailed in a news release.

At one point, a deputy’s K9 vehicle was on fire, and officials were able to get police dog Nina out of the burning vehicle safely.

“Due to their quick response, Nina was safely rescued but sustained minor singeing to her whiskers and fur,” officials said.

The vehicle became engulfed in flames and the surrounding area also caught fire. The blaze was eventually extinguished by the Victorville Fire Department.

Mugica was taken into custody on suspicion of possession of a stolen vehicle, failure to yield and assault with a deadly weapon.