A second officer with the Whittier Police Department and the suspect, a Hispanic man in his 20s, were wounded in the exchange of gunfire, said Lieutenant John Corina of the Los Angeles County Sheriff's Department.
Boyer's partner, Patrick Hazel, was hospitalized in stable condition following the shooting.
Few details have been released about the incident, and it was not immediately clear what prompted the shooting.
Stay with KCRA for updates. As they asked him to get out of the auto and prepared to pat him down for weapons, he pulled out a semi-automatic handgun and began firing at the officers, at least one of whom returned fire, wounding the suspect, Corina said.
A police officer was killed on Monday in a shootout in the Los Angeles area. Boyer recently talked to the chief about retiring in a year or two.
Former USA Gymnasts Detail Sexual Abuse by Doctor in '60 Minutes' Exclusive
Larry Nassar, USA Gymnastics is appalled that anyone would exploit a young athlete or child in the manner alleged". Before Nassar was sacked by MSU in September 2016, he was an acclaimed physician at MSU's sports-medicine clinic.
The Whittier Police Dept. has about 125 sworn officers who patrol Whittier and Santa Fe Springs.
The gunman suspected in the shooting death of Whittier police officer Keith Boyer was an AB 109 probationer, the controversial program that mandates early release for nonviolent offenders, according to media reports.
Whittier Police Chief Jeff Piper said Mejia is an example of how statewide efforts to reduce incarceration of certain criminals can have tragic consequences.
Boyer joined the department as a jailer and dispatcher in 1989 before becoming an officer one year later, according to the Los Angeles Times.
Police later discovered the gunman had been driving a stolen vehicle, and suspect he was involved in another shooting in the East Los Angeles neighborhood the auto came from.
Southern California rain eases, road closures remain
A 55-year-old man died after being electrocuted in the Los Angeles area when he came in contact with a downed power line. Almost three inches of rain fell in the Van Nuys area over a 24-hour period, according to the National Weather Service.
Piper, who described Boyer as his friend of more than 25 years, said the officer had played the drums in an off-duty band with him at charity events.
This makes us stronger, but everybody needs to know what these officers are dealing with out there on a daily basis you have no idea how it's changed in the last four years, we have statistics to show it. "Right now, we are putting people on the streets who are not ready to be on the streets". People don't want to follow rules, people don't care about other people and it's tragic.
The state Senate was expected to adjourn Tuesday in honor of Boyer, according to Sen.
"This is a senseless tragedy that did not need to happen", Piper said. "You never know, when you respond to a call, what you are going to run into".
Getting physical with the cast of 'Fist Fight'
Not that you should be looking to Fist Fight for moral guidance; there might be something seriously wrong if you do. With just one day's notice he flew to Atlanta to meet the Barbershop star.