One of the police officers who was shot Monday night near a Fourth of July gathering in Philadelphia, Pennsylvania, found the bullet still lodged in his hat.

Two law enforcement officers, a 36-year-old Philadelphia Police Highway Patrol officer and a 44-year-old member of the Montgomery County Bomb Unit, were injured in the shooting that happened shortly before 10 p.m. near the Parkway Welcome America Festival.

Philadelphia Fourth of July officer shot

A photo shows a bullet lodged in the blood-stained hat worn by a Philadelphia police officer who was shot in the head on July 4, 2022. (John McNesby/Chris O'Connell/Fox 29)

Photos of the hat worn by the highway patrol officer show a bloodied photo inside the cap with a bullet lodged in its side. The photo is a memorial card for a Philadelphia police chaplain who recently died.

Fraternal Order of Police Lodge 5 boss John McNesby provided the photos to Fox 29.

"It is miraculous the fact that the round stopped in his hat," Philadelphia Police Department Commissioner Danielle Outlaw said. "I think initially it went up the inside and hit his forehead and then the round stopped in his hat."

PHILADELPHIA SHOOTING: 2 POLICE OFFICERS INJURED DURING FOURTH OF JULY CELEBRATION

Authorities said the officer was stable when he was transported to Jefferson University Hospital.

Philadelphia Fourth of July officer shot

A photo shows a bullet lodged in the blood stained hat worn by a Philadelphia police officer who was shot in the head on July 4, 2022. (John McNesby/Chris O'Connell/Fox 29)

The other officer, who was shot in the right shoulder, was transported to the same hospital.

About two hours later, the unidentified officers were released, Fox 29 reported.

Videos taken at the scene showed a large police presence directing people away from the area where the shooting took place.

Other videos showed hundreds of people running away from the area. It was estimated that up to 100,000 people were in attendance at the Fourth of July celebrations.

CLICK HERE TO GET THE FOX NEWS APP

Authorities have not yet arrested a suspect and no persons of interest have been identified.