A carjacking suspect and a police dog both died Wednesday after a pursuit ended with a crash and a shootout in suburban Chicago, authorities said.

Officers were trying to execute a traffic stop in South Elgin on a man wanted on a warrant when the man fled to Batavia, where he crashed at an intersection, the Kane County Sheriff’s Office said.

The suspect got out of his car holding a handgun, at which point the police dog was turned loose, the sheriff's office said.

VIDEO CAPTURES WILD BRAWL AT CHICAGO'S O'HARE AIRPORT, LEADING TO 2 ARRESTS

The suspect shot the dog, and police opened fire on the suspect, authorities said.

Illinois crime, Aurora crime

A police dog and a carjacking suspect both died on May 24, 2023, in Batavia, Illinois, during a shootout. (Fox News)

The man's name wasn't immediately released.

CLICK HERE TO GET THE FOX NEWS APP

No other officers were struck by gunfire or otherwise injured, the office said.