CASTRO VALLEY (CBS SF) — Two Alameda County sheriff’s deputies who were searching for two missing boys shot and wounded a transient man who charged at them with knives in unincorporated Castro Valley on Sunday night, a sheriff’s spokesman said.

The suspect, 46-year-old James Saunders, is in stable condition at hospital and is expected to survive gunshot wounds to his shoulder, leg and ankle, sheriff’s Sgt. Ray Kelly said.

The incident started at about 7:30 p.m. Sunday when a woman who lives in the 5000 block of Old Dublin Road in unincorporated Castro Valley reported that her sons, ages 11 and 12, had gone missing, Kelly said.

Cave 46-year-old James Saunders was using for shelter at the park. (CBS)

Cave 46-year-old James Saunders was using for shelter at the park. (CBS)

The boy’s uncle looked for the boys in a wooded area in a nearby creek where they often play but wound up encountering Saunders, who allegedly confronted the uncle with a 9-inch “Rambo” knife and threatened to harm him, according to Kelly.

When deputies arrived in the wooded area, Saunders “ambushed” them by confronting them with the “Rambo” knife in one hand and a 9-inch hunting knife in his other hand, Kelly said.

Kelly said the deputies ordered Saunders to drop the knives but he ignored their commands and threw the knife that was in his right hand at one of the deputies but missed.

Saunders then charged at both deputies with a knife in his left hand but when he got within a few feet of them, the deputies, who feared that Saunders was trying to kill them, each fired several rounds at him, according to Kelly.

Saunders is in custody at a hospital and when he recovers he will be transferred to Santa Rita Jail in Dublin on suspicion of two counts of attempted murder of a police officer, two counts of assault with a deadly weapon on an officer and one count of brandishing a weapon, Kelly said.

The two boys turned up safe at their father’s house in Newark around midnight, having biked there, according to Kelly.

It turns out that Saunders didn’t have anything to do with the missing boys, but deputies didn’t know that when they responded, Kelly said.

“We didn’t know if he had harmed them so we made an all-out effort to find the boys,” Kelly said.

The operation included search-and-rescue teams, helicopters and dogs, he said.

Summing up the incident, Kelly said, “It was a very bizarre situation where there was a routine call for missing children but all of a sudden the deputies were attacked by a man with two knives.”

He said, “This shows that officers always have to be on their toes.”

Kelly said the two deputies who shot Saunders will be placed on paid administrative leave while the incident is investigated.

© Copyright 2015 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.