The man had barricaded himself inside a home on Leeds Court in Livermore at about 9 a.m. after allegedly leading police on a chase earlier this morning, police spokesman Lt. Lance Bye said.
The neighborhood was shut down as police tried to coax the man out of his residence, police said.
The standoff ended at about 2 p.m. and the man, identified as 35-year-old Ryan Jason Brown, is receiving a psychiatric evaluation, Bye said.
After his mental health status is established, Brown will be arrested and charged with felony evasion of a police officer, Bye said. The charge stems from the early morning pursuit.
The ordeal began when police pulled Brown over for a routine traffic stop at about 1:30 a.m. today, Bye said. When the officers began investigating whether he was driving under the influence, Brown sped off and a pursuit ensued, Bye said.
Brown was able to evade police this morning, at one point crashing his car through a fence near his neighborhood before returning to his home at 2556 Leeds Court in Livermore, Bye said.
It was from that address that Livermore police received a call at 9 a.m. today, when a friend of Brown's mother reported that Brown was in the house with a gun and was despondent, Bye said. The caller was worried because Brown had told his mother "he'd rather kill himself than go to jail," Bye said.
Authorities determined that Brown was alone in the house and issued a shelter-in-place warning for the neighborhood, forcing all residents to stay indoors until the situation was resolved, Bye said.
He said police escorted several people who had appointments out of the neighborhood but that there were no formal evacuations.
The shelter-in-place warning was lifted at 2:15 p.m.
After four hours of little more than intermittent peeks from the window, Brown finally made contact with the tactical team at 1:30 p.m. by calling 911, Bye said.
He made several requests, including being allowed to contact his lawyer, and then spoke to negotiators for half an hour before surrendering, Bye said.
Brown did not have a gun with him when he exited the home, but Bye said he believes officers did find a firearm inside the home.