Portland police officers were attacked late Monday night when they were aiding a gunshot victim.

Bashir Hassan, 35, of Portland was shot near Smith Street and Kennedy Park about 11 p.m. and attacked as he lay on the ground, according to Maj. Robert Martin, a spokesperson for the Portland Police Department.

When they arrived at the scene, police officers rendered first aid to Hassan until paramedics arrived. He was taken to Maine Medical Center, where he was listed in stable condition.

As they aided Hassan, a “hostile” crowd began to form around them and shot fireworks at the officers as they contained the crime scene, Martin said Tuesday.

In response, officers fired pepper balls, a nonlethal projectile containing capsaicin powder, at the crowd to protect police and paramedics, according to Martin.

Martin said it was the second year in a row when officers were attacked with fireworks near Kennedy Park over the July 4 holiday weekend.

“I’m incredibly proud of the skill and professionalism of our officers who rendered life-saving aid while being targeted themselves,” Chief Heath Gorham said. “This dangerous behavior has no place in our community.”

The suspected shooter was described as a black man with a large build and about 6 feet tall.

Anyone with information about the shooting can contact Portland police at 207-874-8575.