Updated

Two suburban Los Angeles police officers thought they were helping a driver after a car crash.

Then, they say, he pulled a gun.

Whittier Officers Keith Lane Boyer and Patrick Hazell didn't know that the motorist allegedly had killed his cousin hours earlier in neighboring East Los Angeles and stolen his car.

"They walked up on the vehicle believing the motorist was in need of medical help and then they ended up in a gunfight for their lives," Los Angeles County Sheriff Jim McDonnell said.

Monday's morning's shootout killed Boyer. It left Hazell and the suspected gunman hospitalized and Whittier in shock.

Boyer was "the best of the best," Police Chief Jeff Piper said at an afternoon news conference. He wept as he described his friend of more than 25 years.

"All of us have been grieving," the chief said. "And I didn't think I had any tears left."

The officers answered the report of a car accident at about 8:30 a.m. and a driver pointed them to the vehicle which had rear-ended his car, police said.

That driver had gotten out and asked those he had hit to help push his stolen car from the intersection, investigators said.

The officers approached the motorist, a 26-year-old gang member with a history of serious offenses who had been granted early release from jail about a week ago, county sheriff's Lt. John Corina said.

"When they get him out of the car, they go to pat him down for weapons, they can see he's got tattoos all over his face and all over his neck," Corina said.

The man then pulled a semi-automatic handgun from his waistband and opened fire at the officers, who were wearing bulletproof vests and shot back, Corina said.

Boyer was pronounced dead at a hospital. Hazell and the alleged gunman, whose name wasn't immediately released, were hospitalized in stable condition and were expected to live, authorities said.

Corina didn't immediately know why the gang member had been jailed or why he had been released early.

But Piper and McDonnell criticized laws designed to reduce the state's overcrowded prison population by moving some inmates to county jails and effectively reducing some sentences or providing early release.

"This is a senseless tragedy that did not need to happen," Piper said.

Gov. Jerry Brown issued a statement of condolence. Capitol flags were ordered to be flown at half-staff in Boyer's honor.

Boyer joined the force as a dispatcher and jailer in 1989 and became a full-time officer in 1990. Boyer recently talked to the chief about retiring in a year or two.

A divorced father with two adult sons, he played the drums in an off-duty band at charity events, with Piper sometimes playing guitar, the chief said.

At the candlelight vigil, he promised to write a song in Boyer's honor.

The Whittier Police Department has about 125 sworn officers who patrol Whittier and Santa Fe Springs.

The department has had two other officers killed in the line of duty — a detective in 1979 and a corporal in 1977.