Updated

California police Tuesday were mourning a cop hailed as one of “the best of the best” following his death in a shootout involving a 26-year-old gang member with a history of serious offenses.

"All of us have been grieving," Whittier Police Chief Jeff Piper told reporters after Monday’s incident that killed Officer Keith Lane Boyer. "And I didn't think I had any tears left."

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. A divorced father of two, Boyer joined the police department as a dispatcher and jailer in 1989 and became a full-time officer in 1990. Boyer recently talked to Piper about retiring in a year or two.

POLICE: PAROLED GANG MEMBER FATALLY SHOOTS OFFICER AFTER CAR CRASH

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

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

The Whittier Police Dept. has about 125 sworn officers who patrol Whittier and Santa Fe Springs. It has had two other officers killed in the line of duty — a detective in 1979 and a corporal in 1977.

POLICE: MAN SHOT BY OFFICER AFTER OPENING FIRE NEAR CALIFORNIA ZOO DIES

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

Boyer and Officer Patrick Hazell didn't know Monday when they were responding to the scene of a car crash that the driver allegedly had killed his cousin hours earlier in neighboring East Los Angeles and stolen his car. Police didn't immediately name the suspect.

"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 shootout left Hazell and the suspected gunman hospitalized.

"It looks like he's gonna live," Los Angeles County Lt. John Corina said about the suspected gunman, Fox 11 reported. Hazell is also expected to survive, authorities said.

The two 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, 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.

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.

Click for more from Fox 11.

The Associated Press contributed to this report.