Prosecutors and defense attorneys agreed that Kashif Bashir could not assist in his own defense or understand the proceedings in his case, and they asked an Alexandria Circuit Court judge Thursday to declare him unfit for trial, authorities said.

Judge James C. Clark entered an order declaring Bashir incompetent, meaning proceedings in his case will be put on hold unless the 27-year-old can be rehabilitated, said Alexandria Assistant Commonwealth’s Attorney Bryan Porter.

Emily Beckman, Bashir’s attorney, had written in a court filing that her client thought people involved in the case had shape-shifted and communicated with him telepathically. A doctor was then ordered to evaluate him and complete a report — which remains sealed — about his competency, Porter said.

Prosecutors have accused Bashir of shooting and wounding Officer Peter Laboy in an apparently random daylight attack in Old Town Alexandria on Feb. 27. First-graders at a nearby school were outside playing when the shooting occurred.

Bashir was arrested after a high-speed chase and is charged with attempted capital murder of a police officer. Laboy was critically wounded but has substantially recovered. He recently left for a vacation to see family in Florida and the Dominican Republic, according to a blog that his wife maintains.

In filings before Thursday’s hearing, Beckman wrote that Bashir asked whether his lawyers were the police detectives who interviewed him “in another form,” and “expressed the belief that one of his lawyers might have visited him inside the housing unit of the jail in the form of a much older jail worker.”

Beckman wrote that Bashir also thought that a prosecutor communicated with him telepathically in an earlier hearing and was convinced that a prosecutor and judge had continued to do so after that.

Porter said Bashir will temporarily be sent back to jail but then will be transported to a state hospital so he can be treated by psychologists and psychiatrists. Another hearing is scheduled Jan. 9, although Bashir could appear in court sooner if hospital officials think his condition improves to the point where he can understand court proceedings, Porter said.