A judge has ruled a hearing over whether Dylann Roof is competent to stand trial for the killings of nine black people in a Charleston church will happen behind closed doors.

Judge Richard Gergel issued an order Wednesday saying he had to keep the public out of the hearing to protect Roof's right to a fair trial.

Gergel says there will be interviews with Roof and evidence presented at the hearing that he is still deciding on whether to allow at the death penalty trial.

Prosecutors and several media organizations want to keep the hearing open. They can argue against Gergel's order Thursday.

Gergel says the competency hearing will be Monday. Jury selection is tentatively scheduled to start on Nov. 28 if Roof is found competent.