SAN BERNARDINO >> A shaken Police Department waited anxiously Friday to hear if one of its police officers will survive being shot once in the head and twice in the upper body after an early-morning gun battle at 19th Street and Garner Avenue.

Police identified the officer as 31-year-old Gabriel Garcia. His father, Captain Ron Garcia, is operations director for the department and a life-long veteran of SBPD.

The young officer was listed in very grave condition after surgery Friday at Arrowhead Regional Medical Center in Colton.

“Gabe is an outstanding officer, a great team member and a great man,” Police Chief Jarrod Burguan said. “He has always displayed extreme professionalism and a great attitude toward his job.”

Burguan asked people to keep Garcia and his family in their prayers, and described the officer as exemplary in every sense of the word.

“Officer Garcia has earned the utmost respect from fellow officers and the department as a whole,” Burguan added. “His calming and compassionate nature has earned multiple letters from citizens thanking him for his assistance with crimes such as armed robberies and carjackings.”

Garcia is divorced and has one child.

“Every single one of the SBPD officers involved displayed bravery this morning. Our community needs your help to rally support for our officer who is in grave condition this morning,” San Bernardino police said in a statement on their Facebook page. “Our hearts go out to the officer and their family. Please send prayers and support.”

Police said the shooter was killed by return fire from the trainee and five suspects have been detained in connection with the shooting.

The dead gunman was identified as Alex Alvarado, 38, of San Bernardino. Police said Alvarado is a long-time member of a criminal street gang based in Redlands.

Johnathan Contreras, 20, was arrested as an accessory in the shooting, and Orlando Cruz, 24, was arrested for outstanding warrants. The three others detained by police have not yet been identified.

Police said Garcia was shot with an assault rifle during a protracted gun battle. His trainee was not wounded and has not been identified.

Burguan said shortly after 2 a.m., Garcia and his trainee came across six individuals walking near 19th and Garner.

“When Garcia and his trainee got out of their patrol car, one of the individuals began to open fire,” Burguan said.

The trainee shot and killed the gunman who died at the scene, Burguan said. The trainee has only been out of the academy for two months.

A rifle and handgun were found next to the gunman’s body. Police have recovered an AK-47 rifle and a revolver.

Burguan said the suspects had met earlier at a local club, got alcohol and then went to the location of the shooting. They were in front of a residence, but police have not determined if they had a connection to that residence, he said.

Ahmad McPrime lives in the neighborhood where the shooting took place. He said his house is adjacent to the backyard of the home where the shooting occurred.

McPrime was in his backyard with a friend when he heard two shots that sounded like a .38.

There was a pause and he heard bullets spray from an automatic rifle. He could hear them whizzing.

“I seen the boy fallin back, boom, boom, boom, boom, boom with that K (AK).”

You could here the cop yelling get down.

“That boy wasn’t getting down for nothing,” McPrime said. “He just kept shooting.”

He said the shootout seemed to last several minutes, covering a large area.

“I am very sorry to share that two of our San Bernardino officers were involved in a shooting with multiple suspects early this morning. After his partner was shot multiple times by an armed gunman, another officer returned fire, killing the gunman and fending off suspects until additional units arrived on scene,” Mayor Carey Davis said.

“It is deeply upsetting to hear that the senior officer who was shot is in critical condition at this time. My prayers go out to this officer and his family — and to the entire department of brave men and women who put their lives on the line for us every day in order to protect us. Your thoughts, support and prayers are very much appreciated as we work through this tragic ordeal,” he said.

Beginning early in the morning and for hours afterward, police and investigators studied the taped-off area of the shootout, about two blocks east of Mount Vernon Avenue and separated from the railroad and 215 Freeway only by a field with mounds of trash.

Neighbors were divided on the condition of the neighborhood.

“A lot of people walk by at night, but no guns,” said Victor Villanueva, who was awoken by gunshots and then saw “cops were everywhere” almost before he could process what happened. “(We have) no problems like that. I thought it was a train — someone trying to break into one of the trains.”

A bit more than a block away, James Woods, 58, gave a heavy sigh before saying he had woken up to gunshots but quickly gone back to sleep.

“I hear those all the time,” said Woods, who runs a safe house on Tumill Avenue. “In five years it’s (the area) gone down a lot, not slowly. You see drugs and all the things that brings with it.”

At the hospital, Stater Bros. brought food and drinks for family members waiting word on the wounded officer.

Many residents expressed sympathy for the officer and his family.

“I’ll lift him up in prayer,” Linda Redford said as she walked her granddaughter to school. “People just don’t fear the police anymore. I pray that things change.”

Staff writers Greg Cappis, Jim Steinberg and Joe Smilor contributed to this report.