According to investigators, a senior officer and his partner were doing a neighborhood check around 2 a.m. when they saw a group of people -- four men and two women -- outside a home on the 1900 block of Garner Avenue. Police say there was no warning when the suspects started shooting.
"They got out of their car to make contact, and almost immediately upon making contact, they came under fire. The first officer was hit. The trainee officer was ultimately able to return fire," said San Bernardino Police Chief Jarrod Burguan.
The senior officer, 31-year-old Gabriel Garcia, was struck twice in his upper body, police said at a news conference. Lt. Richard Lawhead told Eyewitness News the officer was struck in the head.
The officer's partner was able to shoot the suspect, identified as 38-year-old Alex Alvarado. Alvarado was transported to a local hospital, where he later died.
Backup officers arrived and four people were eventually taken into custody to be questioned. A fifth person was detained for questioning a short time later.
Detectives are still investigating whether any of the other suspects opened fire.
"I don't have any information right now that would link other people that we have detained having fired a weapon. It is still under investigation. We do know that Mr. Alvarado fired," said Burguan.
Police say they have dealt with several of the suspects before.
"A couple of them are in the system. I don't know how extensive. I don't know if there are specific gang ties at this point, but I think a couple of them are familiar with us," said Burguan.
Jonathan Contreras, 20, of San Bernardino, is going to be charged with possession of an assault rifle and possession of a sawed-off rifle, Burguan said.
Orlando Cruz, 24, of San Bernardino, is being detained on some traffic warrants. Police say, at this point, they don't know if Cruz will be charged with anything else.
The identities of the other people in custody have not been released.
It's unknown what the officers saw that prompted them to make contact. A revolver and an assault rifle with a high-capacity magazine were recovered at the scene, investigators said. Authorities believe both weapons were fired.
Garcia has undergone surgery and remains in very critical condition as of noon. The six-year veteran with the San Bernardino Police Department was training his partner, who has only been out of the academy for about two months. Garcia has a child and has worked patrol for the majority of his career.
"He is a highly commended officer and he has been recognized with his work in terms of anti-graffiti efforts here in the city," said Burguan. "He's an outstanding officer, he's a great team member and a great man. He's always displayed extreme professionalism and a great attitude towards his job, earning the utmost respect from fellow officers and the department as a whole."
Burguan said Garcia's father, Ron Garcia, is a captain at the police department.
Police say the large crime scene stretched at least eight blocks and multiple law enforcement officials responded to the scene.
Vigil held for San Bernardino officer
United in prayer, fellow officers, friends and strangers gathered in front of the hospital Friday night to show their support for Garcia.
"He's a very loving, caring man, he cared about his community and family very much. He was a very good cop," said Kristen, a friend.
"I can tell you as a father there's no tools in life that can begin to prepare you or to get you through such hard situations," said Lt. Tim Crocker with San Bernardino police. "Very, very difficult for them and they're holding in as strong as they can, they're being hopeful."
Garcia is the father of a 2-year-old girl and a six-year veteran of the force.
The chief says the 31-year-old, like his father who is a captain in the department, is committed to his job and the community.
"He is calm and compassionate in nature, has earned multiple letters from citizens thanking him for his assistance with crimes, he is exemplary in every sense of the word," said San Bernardino Police Chief Jarrod Burguan.
Doctors said the next few days will be critical to Garcia's survival. The police chief said the department has never lost an officer to a shootout, and many are praying Garcia won't be the first.