SUNNYVALE, California (AP) — A man described as a disgruntled employee who opened fire on his co-workers at a California limestone quarry was shot and killed by deputies Thursday, bringing an end to a heavily armed manhunt in Silicon Valley.

Three deputies on routine patrol in a Sunnyvale neighborhood encountered the man, identified by a coroner's investigator as Shareef Allman, around 7:30 a.m. local time, Santa Clara County Sheriff Laurie Smith said. He was crouched behind a vehicle in the driveway of a home.

The deputies opened fire after the man "displayed in a threatening manner his firearm," Smith said.

Thursday's shooting took place in a residential area east of the Lehigh Southwest Cement Permanente Plant in Cupertino, where Allman allegedly opened fire during a routine safety meeting on Wednesday. Three people died and six were wounded.

Sheriff's officials late Thursday said they had obtained a surveillance video of Allman that was taken from a security camera that showed Allman walking with a rifle after the shooting.

Authorities believe Allman also shot a woman in an attempted carjacking a couple of hours after fleeing the quarry.

The ensuing manhunt in Cupertino, home of Apple Inc., and in nearby communities took place as Silicon Valley began to mourn the passing of Apple co-founder Steve Jobs. News of Jobs' death came later Wednesday after authorities had started going door to door with guns drawn and as residents had been warned to stay indoors.

Allman was positively identified through the use of fingerprints late Thursday, said Norma Contreras, an investigator with the Santa Clara County's Coroner's Office.

News that the 47-year-old Allman was the suspect in the attacks shocked his friends, who described him as a devoted single father of two and a longtime community volunteer.

Close friend Brandon Powell said he was horrified to learn of the shootings because Allman had mentioned taking a gun to work days before the attack, but Powell, 20, believed the man he called "uncle" was joking.

Powell told The Associated Press that Allman visited him in Sacramento on Saturday and showed off a recently purchased AK-47 assault rifle. Allman was an avid gun collector who was registered with the state, he said.

When Powell asked Allman what the gun was for, Allman said: "'There's some racist people at my job. They're messing with me,'" Powell recalled.

"We started laughing, so I didn't think he was serious," Powell told the AP in a phone interview Thursday. He added, "He wouldn't hurt nobody. He's not that type of person. He must have snapped."

Powell said he had not contacted authorities but would be willing to speak with them.

Sheriff's spokesman Lt. Rick Sung said Thursday that he was not aware of Powell's claims. He added that any information regarding Allman's motive would be part of the ongoing investigation.

Authorities have not released any details about a possible motive, other than to say the suspect was disgruntled.

Meanwhile, The San Jose Mercury News reported that Allman's ex-wife, Valerie Allman, asked for a restraining order against him in 1992, accusing him of assaulting her on several occasions.

A Santa Clara County judge granted Valerie Allman's request and also ordered Shareef Allman to move out of her house, according to court records.

The couple also divorced about the same time, according to the newspaper.

Allman was recently suspended following an accident in which he hit a power line while dumping a truck load at the quarry, according to Bill Hoyt, secretary-treasurer of Teamster's Local 287.

Hoyt said Allman visited his labor union offices on Friday, saying he felt he was being treated unfairly by cement plant management, Hoyt said.

Another longtime friend, Walter Wilson, said Allman complained of racism at work, but he didn't think it was a major issue for him.

"As far as I know he was the only African-American truck driver," Wilson said. "He told me the company was racist."

"I tried to tell him to go through the process, and he said he felt like he had it under control," said Wilson, who last saw Allman three weeks ago at a music festival and described him then as happy and jovial.

In addition to working at the quarry, Allman had run a nonprofit group for youths and produced and hosted a public access television show for CreaTV in San Jose. He also wrote a novel titled "Saving Grace," about the evils of domestic violence.

"He spent his life in the service of other people," Wilson said.