Dylann Roof (right), the 21-year-old man charged with murdering nine people 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 July 16, 2015. REUTERS/Randall Hill

A friend of the gunman accused of slaying nine black parishioners in a 2015 attack on a South Carolina church will plead guilty on Friday to lying to investigators and concealing knowledge of the plan, court documents show.

Joseph Meek, 21, plans to plead guilty to withholding information about a crime and making false statements to authorities investigating the massacre in Charleston, according to documents filed earlier this week.

Under a plea agreement, he could be called to testify against his childhood friend Dylann Roof, 22, who has been accused of opening fire during a June 17 Bible class at the historic Emanuel African Methodist Episcopal church.

Meek, who like Roof is 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.

The plea hearing is scheduled for 1 p.m. on Friday before U.S. District Judge Richard Gergel in Charleston. By cooperating with authorities, Meek could be spared the maximum sentence of eight years in prison, four years of supervised release and more than $500,000 in fines.

Two survivors of the shooting, Felicia Sanders and Polly Sheppard, will attend the hearing, their lawyer Andrew Savage said in an email.

"They appreciate that he is accepting responsibility for his failure to notify authorities of his friend's hateful remarks," Savage said.

Meek's father told local reporters this week that his son was not in the wrong and also was not best friends with Roof.

"If you called 911 every time somebody said, 'OK I'm going to do this, do this,' it'd be flooded with non-legit calls," he told WIS-TV in South Carolina.

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 capital punishment against Roof, who is charged with nine counts of murder as well as attempting to murder three people who survived the rampage, in a trial scheduled to begin in January.