BATON ROUGE, La. -- A local prosecutor says he believes police were justified in firing back at a man they had chased through a Baton Rouge neighborhood before dawn Saturday.

Neighbors awakened by the gunbattle say dozens of shots were fired in a barrage that left two officers and the suspect wounded.

Baton Rouge Police Chief Carl Dabadie Jr. said the officers' injuries didn't appear to be life-threatening. The suspect, identified as 22-year-old Calvin Smith by authorities, was critically injured.

Get Breaking News Delivered to Your Inbox

East Baton Rouge Parish District Attorney Hillar Moore said a bullet grazed the head of one officer; the other officer was hit in the stomach but protected by his bulletproof vest. Neither officer was identified.

"These guys are fortunate to be alive," Moore said. "God didn't want to take them today. It was not their day."

"One more inch and an officer is dead," Moore said, according to CBS Baton Rouge affiliate WAFB-TV.

Gina Chambers said Smith, the son of her godmother, was on a ventilator Saturday afternoon and might not survive. She said Smith had been living at her Baton Rouge home since December.

Chambers said Smith has been grappling with "mental issues" and had attempted suicide before he moved from Shreveport to his native Baton Rouge. Chambers said Smith received mental health treatment last year after the suicide attempt at a hospital in Shreveport, where he had been living with a sister.

Chambers said Smith has been taking medication for his condition, and she didn't see any obvious signs of distress before the shooting.

"He seemed like he was fine," she said.

Moore said Smith is on probation for a 2014 conviction in East Baton Rouge Parish for indecent behavior with a juvenile. The Advocate reported Smith was accused of having sex with a 13-year-old girl whose mother had reported her missing.

Saturday, officers responded around 5:30 a.m. to a report of someone damaging property, which Moore described as a domestic disturbance reported by a woman who knew Smith.

When police arrived, Smith took off in a vehicle. The officers chased him until he bailed out of his car at Chambers' home, less than 2 miles away. Baton Rouge. Sgt. Don Coppola said Smith jumped out of a Dodge Avenger with a rifle and fired at the officers, hitting both. The officers returned fire and struck Smith. Moore described the rifle as a semi-automatic, large caliber weapon.

Moore said Saturday afternoon that he had personally viewed dashboard camera videos of the six-minute chase from the officers' two cars and believes their actions were "totally justified."

"My first reaction was 'How were these officers not killed?'" Moore said. "Clearly the suspect initiated the firing."

Moore said an investigation will "look at everything" to make an official determination, but described what Smith did as an "ambush." Chambers said she didn't know where Smith had obtained the rifle police say he used.

Moore said at least one of the officers was wearing a body camera, but it wasn't immediately known whether he was able to activate it before the confrontation.

Moore said one officer was white and the other is black. Smith is black.

Coppola said the officers would be placed on paid leave, as is standard in shootings in Baton Rouge.

Police shootings have drawn wide notice in recent months. For example, deputies in suburban Baltimore shot it out Wednesday with an armed man at a sandwich shop. This case differs from those that have provoked outcries nationwide because Smith was armed.

Police remained at the scene of the shooting for nearly five hours, eventually towing away two police cruisers, including one with at least three bullet holes. Neighbors gathered to watch the activity in the neighborhood about four miles east of downtown Baton Rouge, some draped in blankets against the morning chill.

Terrell Starwood, who was staying a friend's house, estimated he heard more than 40 shots. Dozens of evidence markers were on the ground at the house where the chase ended, indicating possible bullet casings.

"You could tell they were from different guns," Starwood said. "I didn't hear nothing but sirens, gunshots and tires squealing."