Gunfire erupted at a Fourth of July celebration in Philadelphia, injuring two police officers, local affiliate FOX 29 reported.

Officers responded around 10 p.m. to the shooting call in the 2500 block of Spring Garden Street, where a massive crowd was gathered to watch a Jason Derulo concert and fireworks display.

The Philadelphia Police Department told reporters that an officer working highway patrol that night was grazed in the head by a bullet. The bullet came to a stop in the officer’s hat.

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

CLICK HERE TO GET THE DALLAS EXPRESS APP

A member of the Montgomery County bomb squad was also injured by a bullet to the right shoulder. Both officers were taken to Jefferson University Hospital in stable condition.

Outlaw told reporters at a midnight press conference that both officers were treated and released from the hospital.

The bomb-squad member, 44-year-old John Foster, is reportedly recovering at home, according to FOX 29. He is a 17-year veteran of the sheriff’s office.

The highway patrol officer was 36-year-old Sergio Diggs, a 13-year veteran of the department.

The gunfire caused the massive crowd to scatter in the middle of the fireworks display, adding more confusion to an already chaotic situation.

Police are still investigating, and no arrests have been made. Officers also have not determined what caused the shooting.

Mayor Jim Kenney spoke outside the hospital where the officers were recovering.

“I’m waiting for something bad to happen all the time,” Kenney said. “I’ll be happy when I’m not mayor, so I can enjoy some stuff.