A young man's decision to stop others from reporting that Dylann Roof had likely killed black worshippers in Charleston put the community in "extraordinary" danger, a federal judge said Tuesday.

For that choice, 22-year-old Joey Meek, a friend of Roof's, will serve two years and three months in prison.

Meek had brushed off Roof's scheme to carry out mass violence as a drunken rant. But he didn't break the law until the attack came to fruition, when he told others to sit idle.

The community was fortunate that Roof did not commit further violence because of Meek's inaction, Judge Richard Gergel said in handing out the punishment at U.S. District Court in Charleston. The judge noted that Meek was more focused on not getting into trouble.

"He put his own interests ahead of ... the interests of the community," Gergel said. "We want other people in a similar situation to make the right decision that this defendant did not."

Barring appeals, Tuesday's proceeding brought to a close the federal cases against the two men charged in the 2015 racially motivated massacre of nine parishioners at Emanuel AME Church. Roof, who was convicted and sentenced to death earlier this year, still faces a possible murder trial in state court.

Meek's prison term fell on the low end of the 27 to 33 months recommended by sentencing guidelines. Arguments by his defense team for a lesser penalty and by prosecutors for a greater punishment were rejected.

While acknowledging Meek's reform efforts, the judge called his crimes "serious."

The Lexington County resident had faced up to eight years in prison after pleading guilty last year to misprision of a felony and lying to federal agents. He had already served more than a month behind bars before his release on bail. Gergel already had ruled that Meek could not face stiffer penalties for not helping to prevent the June 2015 mass shooting.

He was not immediately imprisoned after his sentence was announced. Instead, he will be allowed to report later to the prison to which he is assigned. After his release, Meek must undergo mental health counseling and drug testing during a year of federal supervision.

After the more than two-hour hearing, a loved one of the shooting victims' emerged from the courthouse and said, "I'm satisfied. Satisfied." Others walked away, silently.

Meek, dressed in a black suit, issued a tearful apology in the courtroom that echoed a letter he had penned weeks ago to the judge.

"I am really, really sorry that a lot of beautiful lives were taken," he said.

His attorney, Deborah Barbier of Columbia, stood outside later and said Meek wants something positive to come from the ordeal.

"His hope is that if ... anybody has a friend who is saying things about hurting someone, that they'll take it seriously," she said, "that they'll learn from his mistake and that they'll notify the proper authorities."

Meek and Roof were childhood friends who reconnected before the burst of hate-filled violence, spending time together doing drugs, playing video games, and talking about Roof's racist beliefs and plans to kill people in Charleston.

Fearing what Roof might do, Meek once took his friend's .45-caliber Glock and hid the weapon, only to return it.

Roof later went to Emanuel carrying 88 hollow-point bullets and sat through a Bible study. He listened for nearly an hour before standing and unleashing a barrage of bullets on the parishioners, shooting each of the slain victims several times. Three made it out alive.

That night, authorities said, Meek learned on social media about what happened. He talked about the news with at least one friend, he later told investigators, but he urged that young man to keep quiet.

Gergel often interjected during Tuesday's proceeding to clarify that this is when Meek first broke the law.

"He knew who (the gunman) was," Gergel said. "He affirmatively acted to stop someone else from reporting it."

Others spoke out early the next day. But when confronted by FBI agents, Meek lied by denying the extent of his knowledge of Roof's plot.

Two witnesses on Tuesday sought to help the defense argue for a lesser sentence. James Aiken, a corrections expert, said Meek would likely be labeled a "high-value" target in prison because of his link to a heinous, racially motivated crime.

But Gergel said a sentence that didn't call for Meek's incarceration would be "illogical."

Dr. Thomas Martin, a psychiatrist, also testified that Meek had "made headway" in fighting anxiety, depression and attention deficit disorder.

Meek struggled with an unstable childhood, physical abuse and a drunken father who threatened to kill him, Martin said. He "had the coping and problem-solving skills of a 2-year-old," Martin explained.

Since his arrest, he has taken medication, found a full-time restaurant job and become more empathetic, the doctor said.

"If he was handed these same circumstances," Barbier added, "he would handle it much differently now."

But the judge said he saw Meek as a young man who had been going the wrong direction in life. Meek had amassed a rap sheet with four misdemeanor charges, including a burglary arrest.

Lead prosecutor Jay Richardson also agreed with Gergel that Meek tended to "sugarcoat" his version of the crime by boiling it down to his failure to report Roof's scheme before the attack instead of focusing on how his inaction afterward might have put more people in the line of fire.

"The defendant recognized ... that (Roof) was a real danger," Richardson said. "He knew who it was. He knew there was a continuing threat."

Neither the prosecutor nor the defense team commented on the sentence that was meted out. Meek would decide whether to appeal, Barbier said.

"He's going to pay his debt to society," the lawyer added. "It's his hope that the spirit of forgiveness — as demonstrated by the victims of the AME tragedy — will be extended to him."

Reach Andrew Knapp at 843-937-5414 or twitter.com/offlede.

Andrew Knapp is editor of the Quick Response Team, which covers crime, courts and breaking news. He previously worked as a reporter and copy editor at Florida Today, Newsday and Bangor (Maine) Daily News. He enjoys golf, weather and fatherhood.

We're improving out commenting experience.

We’ve temporarily removed comments from articles while we work on a new and better commenting experience. In the meantime, subscribers are encouraged to join the conversation at our Post and Courier Subscribers group on Facebook.