A young white man accused of shooting dead nine black people in an historic black church has been given permission to represent himself in a trial that carries the death penalty.

A judge on Monday said Dylann Roof could act as his own lawyer and that he would reluctantly accept his “unwise decision” to do so. His lawyers had advised him not to.

The ruling by US District Judge Richard Gergel came on a day that jury selection resumed in the case. It had been halted last week while the judge heard medical testimony to determine whether or not the young man was mentally competent to stand trial.

Nine people were killed in June 2015 inside Charleston's Emanuel African Methodist Episcopal Church (Andrew Buncombe)

After hearing from various experts, Judge Gergel decided that he was fit to be tried over the June 2015 shooting at the Emanuel African Methodist Episcopal Church in Charleston, South Carolina.

In this federal case, Mr Roof is charged with counts that include hate crimes and obstruction of religion. He also faces nine counts of murder and other charges in the state court system. His trial in that case is scheduled to start in January 2017.

Dylann Roof in court

The Associated Press said that from Monday, 516 potential jurors were to report to the courthouse to be individually questioned by the judge. When 70 qualified jurors are picked, lawyers can use strikes to dismiss those they do not want, until 12 jurors and six alternates are seated.

The judge had delayed the process, and ordered the competency hearing after Mr Roof’s lawyers suggested their client either did not understand the charges against him or could not properly help with his defence. The lawyers did not say what led them to question Mr Roof’s fitness for trial.

In pictures: Images attached to Dylann Storm Roof 'manifesto' Show all 10 1 /10 In pictures: Images attached to Dylann Storm Roof 'manifesto' In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof poses with a gun In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof spitting on the American flag In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof poses with a confederate flag and a gun In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof poses with a gun In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof outside the 'Museum and Library of Confederate History' In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures The number 1488 is often associated with neo-Nazi culture In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures In pictures: Images attached to Dylann Storm Roof 'manifesto' Dylann Storm Roof 'Manifesto' pictures Dylann Storm Roof

AP reported that the judge said he took the rare step of closing the hearing to the public and media because Mr Roof made statements to a psychologist that might not be legal to use at his trial and could taint potential jurors.

In his written order, the judge also did not make clear his reasoning. Last Friday, the judge said he refrained from releasing a transcript of the hearing for the same reason, reversing an earlier pledge to release a redacted transcript.

The relatives had complained about the secrecy surrounding the proceedings, but Judge Gergel said he had taken the steps in order to ensure Mr Roof received a fair trial over an incident that had received huge publicity.

According to police, Mr Roof sat through nearly an hour of prayer and bible study at the church with its pastor and 11 others before pulling a gun and opening fire.