Joey Meek, a friend of accused Charleston church shooter Dylann Roof, pleaded guilty in federal court Friday. (Michael S. Williamson/The Washington Post)

A friend of the man accused of killing nine black church members in a mass shooting in Charleston, S.C., pleaded guilty in federal court Friday to lying to the FBI and concealing his knowledge of the crimes, authorities said.

Joey Carlton Meek, 21, of Lexington, S.C., faces up to eight years in prison for the two charges, which stem from the massacre at the Emanuel AME Church in June. Dylann Roof, who is accused of shooting nine people in that case, had stayed with Meek and his relatives, and Meek told The Washington Post in a previous interview that Roof had spoken of going to the church and doing “something crazy.”

Meek claimed he did not take his friend seriously, though when he learned what had happened at the church, he thought immediately of Roof, “He did it.”

Meek was indicted in September on counts of making false statements to the FBI and “misprision of a felony,” meaning he concealed his knowledge of the incident from investigators. A court filing earlier this week had signaled prosecutors and Meek had reached an agreement, which calls for Meek to cooperate with authorities.

Roof faces state and federal charges in connection with the shooting, though trials in both cases have been delayed. State prosecutors have said they intend to seek the death penalty for Roof, while federal authorities are still mulling it over.