Witnesses said it was like a war zone, and they heard at least 20 shots fired.
"Oh my gosh, my heart was beating like down in my feet, it was scary, it was scary," said Edna Mitchell, who was across the street inside a Wells Fargo bank when shots rang out. As soon as Mitchell heard the shots, she and a number of bank customers dove for cover.
The incident happened in the area of Del Rosa and Highland avenues at about 10 a.m. The San Bernardino County Sheriff's Department said deputies were working a robbery and rape case out of Yucaipa. Their investigation brought them to a Stater Bros. parking lot.
"They got information that he was here in the shopping center. When they arrived, they did have a visual on him. That suspect saw the deputies and turned and ran, and then turned back toward the deputies with a gun in his hand and fired several rounds at the deputies," said San Bernardino County sheriff's spokesman Cindy Bachman.
A deputy who was shot in the leg was taken to a local hospital in stable condition. He has since been released. The suspect that he shot was declared dead at the scene.
A woman who was with the suspect was arrested. Police have not released her name or the name of the suspect who was killed.
Police say a woman who witnessed the shooting was taken to a local hospital and treated for chest pains.
The intersection was closed for several hours due to the investigation.
Correction: It was earlier reported that the incident was in the city of Highland. The shootout happened in San Bernardino. It was also initially reported as a bank robbery, but authorities say the shooting stemmed from a robbery-and-rape investigation.