Charleston, SC (AP) - A federal judge has shut out the public from a second hearing on the competency of a man charged with killing nine black people during Bible study at a South Carolina church.

U.S. District Judge Richard Gergel ruled Monday that Dylann Roof's right to a fair trial could be hampered if jurors mulling his sentence learned the contents of the hearing.

Jay Bender, an attorney for The Associated Press and other media outlets, argued against the closure. Bender said closing the hearing to the public would be keeping the community from an important part of the legal process.

Gergel said he would have had to sequester the jury if he opened up the hearing. The judge said he didn't think jurors would intentionally seek out information about the result but might come by it inadvertently, a risk he couldn't take. Gergel said he'd release a transcript of the hearing after a verdict is reached in the case.

Jurors are set to begin hearing evidence Tuesday as to why prosecutors feel he should be put to death for killing nine people at Emanuel AME Church in June 2015.