BIRMINGHAM, Ala. — An Alabama police officer was shot as many as seven times by a suspected armed robber who was then killed in a shootout that ended in what authorities described as a running gun battle through downtown, authorities said Thursday.

The shooting, which happened Wednesday night, was among three involving area law enforcement officers within the span of a few hours. No one died in the other shootings.

Officers were answering a call about a robbery reported at a small grocery store when they saw a man leaving the scene, Police Chief Patrick D. Smith told a news conference.

Officers attempted to stop the man, who pulled out a gun and repeatedly shot Officer Cullen Stafford, Smith said. Authorities responding to Stafford's call for help were met with additional gunfire.

Stafford was shot between five and seven times, and Smith said a bulletproof vest "probably saved his life."

"He was still hit multiple times and he's going to have a long road to recovery," Smith said.

The suspect, whose name wasn't released by authorities, fired a handgun from several locations that stretched across at least five city blocks, ending with a final shootout in which the man was killed, Smith said. Police said dozens of shots were fired before the man died near a parking garage.

Stafford was hospitalized and underwent at least two operations with more surgeries possible. Stafford and another officer were seriously injured when fleeing homicide suspects rammed a patrol car in 2017.

A second officer involved in the pursuit was injured in a fall, Smith said, but was doing "very well." Several officers kept vigil at the hospital early Thursday, which was Stafford's 36th birthday.

Within a few hours of the downtown shooting, a police officer who came upon a gunfight near a public housing development in Birmingham opened fire, authorities said. One person was hurt, authorities said, but he apparently was hurt in the gunfire before the officer fired.

After that, an officer in the Birmingham suburb of Gardendale shot and wounded a man who fled after being spotted in the parking lot outside a church, authorities said.

Authorities didn't release the condition of either man and there was no indication the shootings had anything to do with the downtown gun battle, which Alabama Gov. Kay Ivey said was a reminder of the sacrifice by law enforcement officers.

Birmingham Mayor Randall Woodfin asked for prayers for Stafford and his family.

"We often talk about how our officers put their lives on the line every day for our safety. Tonight is proof of the courage, valor and strength it takes to wear that badge. Officer Stafford, your city stands with you," Woodfin said in a tweet.