Updated

A gunman opened fire Thursday on authorities who tried to serve search warrants at his mobile home in Central California, killing a sheriff's detective and critically wounding a police officer before barricading himself in the residence during a raging gunbattle that also left him dead.

A total of three law enforcement officials were shot in the barrage. A Fresno County sheriff's deputy was also wounded and was in stable condition Thursday evening, authorities said.

Fresno Police Chief Jerry Dyer said authorities used a robot equipped with cameras to confirm the suspect's death Thursday evening following a tense, daylong standoff outside the home in Minkler, a tiny village in a rural section of the San Joaquin Valley.

It was not immediately clear if his injuries were self-inflicted or suffered during the barrage of bullets he exchanged with officers, Dyer said. Authorities need to fingerprint the man to confirm his identity before releasing his name, he said.

About an hour before the robot was sent in, a woman who was inside the home voluntarily came out with a dog spattered in blood, according to Dyer. Her relationship to the gunman was not immediately known and detectives were interviewing her Thursday night, Dyer said.

The bloodshed started just before 10 a.m. when two deputies and a state fire official arrived at the mobile home to serve the warrants connected to a series of arsons and a Tuesday shooting allegedly involving the gunman, Fresno County Sheriff Margaret Mims said.

Both deputies were shot, one fatally, she said. The police officer from the nearby city of Reedley was critically wounded while responding to a call for backup, Mims said.

"We lost a good deputy sheriff today," Mims said.

Police didn't immediately release the names of the two deputies and officer. But Reedley City Manager Rocky Rogers said the wounded officer, who he identified as Javier Bejar, was on life support and not expected to recover.

Rogers said Bejar, who had two years on the police force, was being kept alive so that his family can pay their last respects.

"He had a very commanding presence about him, being a former U.S. Marine," Rogers said.

Mims said the shooter was suspected in a recent series of suspicious fires involving sheds and other outbuildings and of randomly firing a weapon from his home on Tuesday.

Authorities had no contact with the suspect after the gun battle in which hundreds of bullets were exchanged, she said.

Mary Novack, who runs a convenience store across the highway, said authorities used a loudspeaker to repeatedly order someone inside to surrender then smashed down the door.

She saw deputies go inside before hearing gunfire.

"Oh my God, somebody's going to be dead," Novack recalled thinking at the time.

She later saw an officer on the ground.

Jim Stone, 46, who lives about 100 feet from the mobile home, said he left the area after the shooting erupted Thursday morning.

Authorities said the gunman lived with a woman in the mobile home located on sprawling rural property owned by another family in Minkler.

The community of 30 people is located along the scenic highway to Kings Canyon National Park.