A D.C. Superior Court judge ruled Tuesday that the District man charged with a series of hammer attacks in 2012, one of them fatal, is mentally competent to stand trial.

Michael Davis, 20, allegedly struck five people in the head with a hammer during a four-day period last April. The attacks killed a tourist from Denver, Gary Dederichs, 66, and left four others injured.

Davis was charged with first-degree murder and assault with intent to kill in the attacks, which occurred in the Northwest neighborhood of Petworth, where Davis lived with his grandmother.

Judge Robert E. Morin’s decision came after more than a week of hearings and testimony from six psychiatrists.

“The defendant has obtained sufficient factual understanding of the charges against him,” Morin said. “He understands what a trial is, and he trusts and works well with his attorneys.”

Davis is the brother of Vernon Davis, a tight end for the San Francisco 49ers, and Vontae Davis, a cornerback for the Indianapolis Colts. He was a promising football player too, but he has struggled with mental illness much of his life.

Davis’s attorneys, from the District’s Public Defender Service, called two expert witnesses who said Davis was born to a drug- and alcohol-addicted mother, had a history of treatments at psychiatric facilities and had been diagnosed with schizophrenia. Davis is also mildly developmentally disabled, they said.

The prosecutors’ four experts argued that Davis is competent to stand trial because he is on medication and is undergoing therapy at St. Elizabeths Hospital, the city’s psychiatric facility. Davis, the doctors testified, is able to work with his attorneys and understands his case and the charges he faces.

In three reports last year, St. Elizabeths initially found Davis incompetent. But in a final report in December, hospital doctors found him competent.

Davis’s lead attorney, Dana Page, argued that her client did not understand his case but was merely parroting what he had been told by doctors hired by the prosecutors.

Davis’s grandmother, who attended most of the hearings, walked out after the judge issued his ruling.

Morin ordered Davis to remain at St. Elizabeths for more monitoring, and he said he was concerned that Davis’s competency could lapse without constant evaluation and treatment.

“I have concerns,” he said. “But we have to experience the trial to make a determination of his real understanding.”

Page, on behalf of her client, pleaded not guilty to the charges. Page has said her client refuses to plead guilty by reason of insanity because Davis does not believe he is mentally ill.