– The only person with whom Dylann Roof shared his racist plot to massacre parishioners at a historic black church was sentenced Tuesday to more than two years in prison for hampering the investigation and lying to the FBI.

Joey Meek, 22, was initially charged with withholding information from authorities about Roof’s crime and lying to the FBI about his prior knowledge of Roof’s plans to kill black people at the downtown Charleston church. Roof carried out his plan, fatally shooting nine parishioners at a church Bible study group in June 2015.

Near the end of the 2½-hour hearing, Meek choked back sobs and apologized to the families of the victims and law enforcement.

Although Meek knew of Roof’s massacre plans, he was not charged with concealing that information from authorities before the killings. It is not a crime to fail to tell law officers about a proposed criminal act.

Federal Judge Richard Gergel said Meek’s most serious offense was misprision of a felony — not only knowing about a crime but also taking steps to impede the investigation while a killer was on the loose.

Meek’s attorney Debbie Barbier had asked Gergel to consider home detention for Meek.

Gergel rejected that because of the seriousness of crime and the need to send a message that a person can’t obstruct an investigation.

Gergel said Meek can stay out on bond until he reports to prison. He has been living with his grandparents in the Columbia area, working at a restaurant and seeing a psychiatrist.

Barbier had told Gergel that if Meek is put in the general population, “he will be killed,” and if he is put in solitary confinement, his mental and physical condition will deteriorate. That is why she wanted a light prison sentence or an alternative sentence, she said.