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

CHARLESTON, S.C. (Reuters) – The white man accused of slaying nine black parishioners last year at a South Carolina church planned the shooting for six months and wanted to start a race war, said a friend who pleaded guilty on Friday to federal charges in a related case.

Details about suspected gunman Dylann Roof’s plot were revealed as his childhood friend, Joseph Meek, 21, admitted during a hearing in Charleston to concealing knowledge of the crime and lying to authorities investigating the massacre.

Meek could be called to testify against Roof as part of an agreement with prosecutors and may be spared the maximum sentence of eight years in prison for cooperating.

“He told me the week before it happened, that he was going to Charleston and do what he did,” Meek said in court.

Meek, who is also white, is the only other person to be charged in connection with the shootings, which sparked intense debate about race relations and gun control laws in the United States.

He said Roof, 22, shared his plans to open fire during a June 17 Bible study at the historic Emanuel African Methodist Episcopal Church in Charleston.

Roof said he would conceal the pistol he planned to use in a fanny pack and would take his own life afterward, according to Meek.

On the night of the shootings, Meek told others with him that he knew Roof was to blame but instructed them not to call the police, Assistant U.S. Attorney Jay Richardson said in court.

Meek later contacted investigators but for several days denied previous knowledge of Roof’s crime, the prosecutor said.

Meek’s defense lawyer, Debbie Barbier, told reporters that he was scared and shocked immediately after the shooting but now makes no excuse for his conduct.

“He would like nothing better than for the families to forgive him, but he certainly does not expect their forgiveness,” she said.

More than a dozen family members of the Emanuel victims and two survivors of the shootings attended the hearing.

“I am miserable and I have suffered,” Gary Washington, 54, said of losing his mother, Ethel Lance. “Everything has fallen apart.”

Roof faces 33 federal charges including hate crimes, obstruction of religion and firearms offenses. Authorities have accused him of holding white supremacist views, saying he targeted the victims because of their race.

Defense lawyers have said Roof would plead guilty if he did not face the possibility of execution. His federal trial has been repeatedly delayed while U.S. prosecutors decide whether to seek the death penalty.

State authorities are seeking the death penalty against Roof, who is charged with nine counts of murder as well as attempting to murder three people who survived the rampage, in a separate trial scheduled to begin in January.

(Reporting by Harriet McLeod Writing by Letitia Stein and Colleen Jenkins; Editing by Lisa Von Ahn, Paul Simao and James Dalgleish)