The judge in the Charleston church shooting trial released a redacted document relating to the suspect's desire to represent himself in court.

Dylann Roof, 22, faces 33 federal charges in the June 17, 2015, shooting at Mother Emanuel AME Church that claimed the lives of nine parishioners.

In documents unsealed by U.S. District Judge Richard Gergel, he explains the reason for granting Roof's motion to represent himself.

Jury selection was to begin on Nov. 7, but a last-minute motion filed by Roof's attorneys on Nov. 6 prompted Gergel to conduct a closed-door hearing with only Roof and his attorneys present, the documents state. After that hearing, Roof was evaluated to determine whether he was competent to stand trial.

A court-appointed examiner submitted his report on Nov. 15 and the court held a two-day competency hearing on Nov. 21 and Nov. 22, receiving live and written testimony from eight witnesses as well as "voluminous documentary exhibits," the document states.

At the conclusion of the hearing, Roof asked the court, "Is there any way that someone could write a document that would take away all responsibility from my lawyers, but still keep them as my lawyers and then they could do whatever I say, but they wouldn't have any responsibility, and I could sign it?" the document states.

The court informed Roof that his attorneys have a professional obligation to present "an effective defense," the document states, to which Roof replied, "Okay. But I also have a right to represent myself."

Gergel said in the document he advised Roof the court would hear Roof's motion to represent himself, "but that the lack of wisdom in his suggested course of action 'would weigh heavily against [Defendant] having the capacity' to represent himself."

The document continues:

After the hearing, the Court made the following conclusions of law:

1. Defendant does not suffer from any mental disease or defect which renders him unable to understand the nature and consequences of the proceedings against him.

2. Defendant does not suffer from any mental disease or defect which renders him unable to assist properly in his defense.

3. Defendant is competent to stand trial under the standards set forth in 18 U.S.C. § 4241.

Two days later, Gergel said Roof moved to represent himself, prompting a new hearing in which the court asked a series of questions to ensure Roof understood the charges against him, the possible consequences of his decision to "forego representation by experienced counsel," and the court's view that this decision was "unwise."

"Defendant's answers confirmed that his decision was made knowingly and intelligently," the document states.

Roof also confirmed that his decision was voluntary and made after due consideration, that he believes he has the capacity to represent himself and that he was prepared immediately to proceed with jury selection and trial, the document states.

Gergel described Roof's demeanor during the hearings as "alert, focused, and confident" as he fought for the opportunity to represent himself.

However, Gergel maintained his opinion that Roof's decision to defend himself was not the best course of action.

“Defendant's decision to forego the services of the nation's foremost capital defense attorneys is, in the Court's view, unwise, but the law does not permit the Court to reject Defendant's assertion of his constitutional right to represent himself because it is foolhardy,“ Gergel wrote.

Gergel appointed the defense council as "standby counsel" for Roof without objection from prosecutors. Standby counsel can aid Roof if and when he asks for help and can be available "to represent the accused in the event that termination of the defendant's self-representation is necessary," the document states.

Jury selection continues with Roof said to be actively involved in the selection process. As of Wednesday afternoon 34 prospective jurors had been qualified out of 70. Once 70 jurors are qualified, a jury of 12 and six alternates will be selected from that group.