A San Francisco Bay Area police sergeant was shot and killed during an early morning traffic stop Wednesday, and the man suspected in the shooting has been placed under arrest at a hospital where he is being treated for gunshot wounds, authorities said.

Hayward police identified the slain officer as Sgt. Scott Lunger, 48, of Brentwood, California.

"We lost a warrior today," said Hayward Police Chief Diane Urban. "We've suffered a tremendous loss."

Mark Estrada, 21, has been arrested in Lunger's death. He is being treated at Highland Hospital and is under police guard, Urban said.

She said Estrada, who is from Oakland, has gang ties and that he was taken to Highland Hospital in Oakland by relatives. It's unclear whether Estrada is represented by a lawyer who could comment on the arrest.

Lunger was shot about 3:15 a.m. after he stopped a white Chevrolet pickup that was swerving on the road and driving erratically, said Hayward Police Cpt. Mark Koller said.

The driver pulled over, and there was a confrontation. Koller said the driver shot Lunger without warning and that Lunger's partner fired back.

Lunger's partner radioed that shots had been fired and that an officer was down. The partner was not injured.

Police said they found a white pickup truck found in Oakland with bullet holes, a vehicle that matches a description of the truck involved in the shooting.

Lunger was taken to Eden Medical Center in Castro Valley, California, where he later died.

Lunger was on the force for 15 years and became a sergeant in 2009. He was on the gang and the SWAT units.

"He was an ideal police officer," Koller said.

Lunger's family, including two older daughters, has been notified.

Police Lt. Eric Krimm said the Alameda County Sheriff's Department, Hayward Police and the California Highway Patrol are investigating.

Lunger is the second Bay Area police officer killed in the line of duty this year.

In March San Jose Officer Michael Johnson was shot and killed while checking on a mentally ill man who had threated to shoot himself and kill his wife. The man, 57-year-old Scott Dunham fired the fatal bullet. He was also shot and killed that day though he may have shot himself.