A man accused of gunning down an East Palo Alto community leader is now competent to stand trial after a stint in Napa State Hospital for mental treatment, a prosecutor said Tuesday.

Gregory Elarms, 59, of Pittsburg had been found incompetent to stand trial by a San Mateo County judge in July and was sent to Napa.

Two doctors have determined that Elarms has been restored to competency, meaning criminal proceedings against him can resume on charges that he shot and killed his childhood friend David Lewis of East Palo Alto, said District Attorney Steve Wagstaffe.

Elarms allegedly followed Lewis, 54, to the Hillsdale Shopping Center in San Mateo on June 9, 2010, and shot him as Lewis got out of his Honda Accord in a parking lot.

Lewis went to prison at age 19 after getting involved in drugs and gangs, but he eventually became a community leader, drug counselor and a motivational speaker. His slaying went unsolved for six months until Elarms called police and implicated himself.

Elarms told investigators that he slept in the trunk of his car and covered the windows in his house "to keep people from getting to him," prosecutor Al Giannini said.

Elarms believed Lewis had turned against him after trying to mediate a dispute between him and another man, but "none of this was remotely true, as far as police can tell," Giannini said. His concerns appeared to be the result of his mental illness, the prosecutor said.

Elarms was charged with murder, weapons violations and a special circumstance that he lay in wait. Prosecutors are not seeking the death penalty, so the most Elarms could receive if convicted would be life in prison without parole.