A federal judge on Friday ruled that Dylann Roof, the 22-year-old accused of killing nine parishioners in a Charleston, S.C., church last year, is competent to stand trial.

Jury selection will resume in the case on Monday with individual questioning of prospective jurors, the judge said.

U.S. District Judge Richard Gergel made the ruling in a three-page order that kept sealed exactly what he found, a step he said was necessary to make sure Roof gets a fair trial. Hearings on the matter were also conducted in secret.

“After carefully considering the record before the Court, the relevant legal standards, and the arguments of counsel, the Court now finds and concludes that the Defendant is competent to stand trial,” Gergel wrote.

Roof is charged with federal hate crimes in connection with the June 2015 shooting at the Emanuel AME Church. Prosecutors have alleged he carefully planned the attack, which was motivated by his animosity toward African Americans.

In the shooting’s aftermath, authorities said they found a racist manifesto Roof had posted on his website and modified just hours before the attack. The site was filled with racial stereotypes and diatribes against black, Jewish and Hispanic people as well as photos of Roof holding a .45-caliber Glock pistol and a Confederate flag.

Prosecutors are seeking the death penalty, and Attorney General Loretta E. Lynch has said the “nature of the alleged crime and the resulting harm compelled this decision.”

Jury selection was supposed to have begun in the trial earlier this month, but Gergel suddenly put the proceedings on hold to evaluate Roof’s competence after defense attorneys came to him with some type of evidence that would call into question their client’s ability to understand the proceedings. The judge appointed James C. Ballenger to conduct the review.

A determination that Roof is competent means that he understands the nature of the proceedings against him and can assist in his own defense. Roof is also facing state charges in connection with the killings, but that trial also has been delayed because of concerns about competence.

A defense attorney for Roof did not return a message seeking comment. A spokeswoman for the U.S. Attorney’s Office in South Carolina declined to comment.