An undercover Dearborn, Michigan police officer was shot at while working to recover a stolen car in Detroit on Monday.

The car's owner reported it stolen and told them it had an Apple Airtag on it. Police followed the location to Detroit. 

GEORGIA BUREAU OF INVESTIGATIONS INVESTIGATES OFFICER-INVOLVED SHOOTING

When officers arrived on the scene, the stolen car was parked and two males were outside. According to Michigan State Police, one of the males fired a shot that hit the hood of the undercover officer's car and then went through the hood of the officer's sweatshirt and into the headrest of the back seat. Remarkably, the officer was not hurt. 

Officers executed search warrants at two homes in the area. They recovered four weapons and arrested two males in connection with the shooting. A third male was also arrested on outstanding warrants from another department. 

IDAHO MURDERS: BRYAN KOHBERGER SEEN ON BODY CAMERA FOOTAGE DURING TRAFFIC STOP IN INDIANA

"In this case, without provocation, the officer was fired upon numerous times. Mostly likely from a high-powered assault rifle. His vehicle was struck multiple times," Dearborn Police Commander Tim McHale told Fox 2 Detroit. "In this case bullets came within inches of hitting him. So he's very fortunate in this case." 

CLICK HERE TO GET THE FOX NEWS APP

The two shooting suspects were apprehended and are at the Detroit Detention Center, and police will be submitting their findings to the Wayne County Prosecutor's Office.