A Superior Court justice this week declared Leroy Smith III competent to stand trial in the slaying of his father in 2014 in Gardiner.

Smith, 27, is accused of killing his father Leroy Smith Jr., 56, in May 2014 in their Gardiner apartment, dismembering the body and disposing of various parts.

Earlier this year, psychiatrists testified in court about Smith’s mental state while he is being held at Riverview Psychiatric Center in Augusta.

Smith has said he acted in self-defense because his father was poisoning his food with D-Con and that the bands Slayer and Phish were involved, as well as Hells Angels.

Smith was the first person in Maine to be forced — under a 2015 law — to take psychiatric medication in an effort to restore his mental capacity to a level at which he can participate fully in his own defense.

In her written decision issued Monday, Justice Michaela Murphy writes that while there are some cases in which someone accused of a crime is so delusional he or she cannot participate in mounting a defense, she thinks that description does not fit Smith.

“On the contrary, Mr. Smith has been able, with the assistance of his counsel, to formulate alternative legal strategies which he clearly understands,” she wrote. “He can articulate the order in which his counsel will proceed to make certain arguments, and understands what will happen if those arguments fail to carry the day.”

Assistant Attorney General Donald Macomber, who is prosecuting the case, said via email Thursday he had no comment on Murphy’s decision. Defense attorney Scott Hess did not respond to a request for comment.

Three forensic psychologists testified in January that Smith has made progress over the past year or so while on medication.

Under questioning by Macomber, Dr. Carlyle Voss, a forensic psychiatrist, said the medication had improved Smith’s emotional control and that being moved to a lower-stress unit at Riverview has helped as well.

At the close of a February hearing, Murphy told Smith, “You understand you are still under an order to take your medication.”

He responded, “I understand all that.”

Voss said Smith has been diagnosed with delusional disorder and paranoid schizophrenia.

The next step will be for the attorneys to meet with Murphy to schedule a trial. In her written decision, Murphy concludes that “the state has proven by a preponderance of evidence that Mr. Smith is now competent to stand trial.”

She further orders the Riverview staff to provide reports on Smith’s mental condition every two weeks beginning May 12 until the trial.

According to information in an affidavit by Maine State Police Detective Jonah O’Roak, the younger Smith told case investigators he had killed his father and then “filleted him and buried him in the woods because his dad sexually assaulted him his whole life.”

There was no record of Leroy Herbert Smith Jr. on a sex offender registry in the United States. The younger Smith had lived in Massachusetts until moving in with his father not long before the slaying.