CHARLESTON, S.C. (Reuters) - A South Carolina judge on Wednesday delayed the murder trial of the accused gunman in last summer’s Charleston church massacre by six months and rescheduled the proceedings for Jan. 17, 2017.

Dylann Roof (R), the 21-year-old man charged with murdering nine worshippers at a historic black church in Charleston last month, listens to the proceedings with assistant defense attorney William Maguire during a hearing at the Judicial Center in Charleston, South Carolina in this July 16, 2015 file photo. REUTERS/Randall Hill

Judge J.C. Nicholson told a court hearing he had been obliged to push back the trial from its planned start date in July because defense lawyers said a doctor needs two to six months to conduct psychiatric testing of 22-year-old defendant Dylann Roof.

Roof is accused of opening fire on June 17, 2015, during a bible study session at Emanuel African Methodist Episcopal Church and killing nine parishioners, including pastor state Senator Clementa Pinckney, in a crime that shocked the nation.

He is charged with nine counts of murder, as well as with attempting to murder three people who survived the rampage, and he faces the death penalty.

Roof waived his right to appear at Wednesday’s hearing, which was attended by several relatives of the victims.

Doctors will testify during the trial’s sentencing phase about Roof’s use of cocaine and other substances, his mental health, and other background, according to court documents filed on Tuesday.

The judge asked why the doctors were not hired six months ago, and suggested the defense were using “delaying tactics.”

Defense lawyer William McGuire denied that. “Time constraints are tying our hands as well,” McGuire said in court.

Roof’s new trial date could affect when another high profile case is tried in Charleston - that of former patrolman Michael Slager who is charged with murder in last year’s shooting death of unarmed black motorist Walter Scott.

Slager’s trial is scheduled to start in late October. Prosecutor Scarlett Wilson said in court documents filed on Tuesday that she would be willing to try Slager earlier if Roof’s trial were delayed. Nicholson said he would hear arguments on that issue soon.

Roof, who is white, also faces 33 federal charges including hate crimes, obstruction of religion and firearms offenses. Authorities have said evidence showed he had white supremacist views and that he targeted the victims because of their race.

Roof’s trial in U.S. District Court has been delayed several times while the government decides whether to seek the death penalty.

Defense attorneys in both cases have said Roof will plead guilty if he does not face the possibility of execution.