REDWOOD CITY -- A court commissioner denied prosecutors' move Wednesday to quadruple the bail for an Afghan war veteran who is grappling with combat demons and has been charged with felonies as a result of a violent attack in Woodside.

Commissioner Susan Jakubowski kept bail for Milo Imrie, 23, of Richmond, at $25,000, but said he could be released only into the hands of a licensed residential treatment facility.

Imrie, who appeared in court behind a glass barrier and in jail clothes, spoke only when he waived his right to a speedy trial.

Family members hope it will be a turning point for the former Marine who has been slipping toward an abbreviated life since a carnage-filled deployment in the Sangin Valley of Afghanistan's Helmand Province.

Imrie hit bottom Dec. 12 when he reportedly tried to douse himself and a cousin with gasoline and spark a fire. That incident led to a confrontation with police officers during which he is accused of trying to snatch a deputy's gun from its holster.

Prosecutors have charged him with assault with a deadly weapon and trying to a take an officer's gun, both felonies. But they recognize Imrie is ill.

"We want to protect the public," District Attorney Steve Wagstaffe said. "The best way may be to get Mr. Imrie into some kind of mental health care."

Defense attorney Geoff Carr said in court Wednesday that he believes the San Francisco Veterans Affairs center did a "cursory" exam of his client and sent him on his way with some medication after recent visits. Imrie had sought out alcohol abuse help at the center, Carr said.

"They may have failed to make a diagnosis in time," Carr speculated.

San Francisco VA Medical Center spokeswoman Judi Cheary said medical privacy laws prevented her from discussing Imrie's case. But she added all patients who ask for substance abuse help are screened for mental health issues because the two are often related.

A group of concerned family members, including Imrie's father and two brothers, attended the hearing Tuesday to support him.

They said Imrie's mental health issue was not immediate. When he returned from deployment in April 2011 he was just like he'd always been: a calm, bookish, smart aleck who liked to lift weights. He was back, in one piece and his hometown gave him a hero's welcome, complete with flags and signs thanking him for his service.

But a string of personal tragedies that followed, and memories of a horrific moment in combat, started to manifest themselves through drinking, suicidal behavior and signs of mental illness, his family said outside court.

One of the most traumatic incidents happened when he was still in Afghanistan. A colleague, an Afghan interpreter, stepped on an explosive device and was killed while Imrie was on patrol during his deployment with the 3rd Battalion, 5th Regiment "Dark Horse" unit. Their job was dealing with improvised explosive devices.

Imrie, a lance corporal, spotted something suspicious on the ground, but didn't act on his hunch. Moments later the interpreter stepped on the device and was killed.

Then in January, six months after Imrie was honorably discharged, his grandmother Mary Brookings Imrie-McGowan died. In May, his mother, Margaret Bort Imrie, died of cancer. That spring, he was also having problems at UC Santa Barbara, where he enrolled in September 2011.

His brother Parker and father, Gordon Imrie, were already worried about him and suggested he get help. But a frightening report from Milo Imrie's roommate pushed Parker to step up the pressure. The roommate said Imrie, after a bizarre incident in which he broke his car key off in the lock to his glove box, left pancakes burning on a stove while he was staring off into nothing. Imrie subsequently agreed to get help.

But he skipped town after a few meetings with a school psychiatrist and his decline continued.

"I want my brother back," said Parker Imrie, 28, of Richmond. "I feel like I've lost my brother even though he is still alive."

Contact Joshua Melvin at 650-348-4335. Follow him at Twitter.com/melvinreport.