He bought a .45 caliber Glock handgun with money his parents gave him for his 21st birthday and practiced shooting in his South Carolina backyard, taking selfies of himself with Confederate flags. Then, like an increasing number of extremists bent on racial violence, Roof decided to be a lone wolf.

He made a list of potential targets, ultimately picking one of the oldest, historically significant black churches in the South where he hoped to kill as many parishioners as possible. He took along 88 hollow-point bullets, symbolizing Heil Hitler, hoping his act would precipitate racial violence. He expected to encounter police, so he saved a few bullets for himself, intending to commit suicide like so many mass killers have done.

While his storyline may sound familiar to other premeditated acts of U.S. racial violence, there is one largely new component. He wasn’t radicalized by shaving his head bald and joining a neo-Nazi skinhead gang.He didn’t attend Ku Klux Klan rallies to soak up hatred around burning crosses. Nor did he attend Aryan Nations churches where the racist religion of Christian Identity is preached. Dylann Storm Roof learned to hate online.

Roof used a computer to research racial crimes committed on white victims. He walked away with the convoluted notion that a race war going to be his answer.

“The event that truly awakened me was the Trayvon Martin case,” Roof would write in his 2,500-word manifesto. Martin, a black 17-year-old, was fatally shot in 2012 in Sanford, Fla., by neighborhood watch volunteer George Zimmerman. “It was obvious that Zimmerman was in the right,” Roof concluded. “But more importantly this prompted me to type in the words ‘black on white crime’ into Google, and I have never been the same since that day.”

While the case whetted his appetite with misleading stories of a black-on-white crime epidemic, Roof quickly found hate web sites and postings underscoring his radicalized views that whites are the forgotten majority, in jeopardy because of immigrants, often victimized and overlooked by the media and government leaders.

His fellow travelers, and they appear numerous, have polished that view somewhat, promoting an “Alt-Right” ideology of white nationalism that’s now crept into mainstream politics. Alt-Right views were heavily promoted by Breitbart Media, whose chief executive, Steve Bannon, ran Donald Trump’s presidential campaign, and is now “chief strategist and senior counselor” to the President-elect.

But Roof’s online searches quickly took him to one place that proved to be a lynchpin in his own developing views –– the website of the Council of Conservative Citizens, which grew out of a 1950s-era organization that fought school desegregation. The organization opposes race-mixing and also labeled Michael Jackson as an ape while referring to black people as “a retrograde species of humanity.” (After the Charleston shooting, the group posted a web site message saying it was “deeply saddened by the … killing spree.”)

Roof’s Internet research of black-on-white crimes fueled his radicalization, including anti-Semitic views.

“There were pages upon pages of these brutal black on white murders,” Roof wrote, saying he “was in disbelief.”

“At this moment I realized that something was very wrong. How could the news be blowing up the Trayvon Martin case while hundreds of these black on white murders got ignored?” he wrote.

He then apparently became convinced that whites in Europe and the United States were being victimized and force out of jobs by immigrants – the same message frequently sounded by white nationalists and racist groups rebranded as the Alt-Right. He posted his views on a website he created, showing a collection of 60 photos suggesting a fondness for apartheid and the Confederacy, apparently supporting his belief that the wrong side won the Civil War, trial evidence revealed.

He called himself a white supremacist, a white nationalist and said he supported racist ideas of the Ku Klux Klan and neo-Nazis, and expressed the view that black people are inferior to whites. “Negroes have lower IQs, lower impulse control, and higher testosterone levels in general. These three things alone area recipe for violent behavior.” But Roof also was harshly critical of the cowardice of whites who walked away from issues he apparently believed are destroying the white race.

So the young man from Eastover, near South Carolina’s capital, Columbia, spent six months figuring how he could start a race war, making surveillance trips and a list of black churches before eventually picking Charleston’s Emanuel African Methodist Episcopal Church -- fondly called “Mother Emanuel.”

“I have no choice,” Roof wrote in his manifesto. “I am not in the position to, alone, go into the ghetto and fight. I chose Charleston because it is most historic city in my state, and at one time had the highest ratio of blacks to Whites in the country.”

“We have no skinheads, no real KKK, no one doing anything but talking on the Internet,” Roof wrote. Well someone has to have the bravery to take it to the real world, and I guess that has to be me.”

A week before putting his plan into action, Roof stayed briefly at the rural Lexington County, S.C., home of his friend Joseph “Joey” Meek and told him about his intentions. A high school dropout, Meek later was charged with lying to the FBI and concealing a crime. In confessing to those federal crimes, Meek told a judge that he knew in advance of the planned massacre, but told no one. He admitted knowing that Roof planned to kill black people at the Charleston church, hoping to “start a race war because nobody else would do it.”

On the evening of June 17, 2015, Roof drove to Charleston and parked in the Emanuel AME church parking lot. Trial testimony revealed that he sat in his car for several minutes, spending some of that time carefully loading 88 hollow-point bullets –– his symbolic remembrance of “Heil Hitler” –– into eight ammunition magazines that he could quickly use to reload his Glock.

After stuffing the semiautomatic handgun and the clips into a fanny pack, Roof entered a unlocked side door of the church and took a seat at a weekly Wednesday night Bible study meeting, spending about 45 minutes with the group, trial testimony indicated. The congregants warmly welcomed the young white man, and handed him a Bible and sheet of scripture verses. He sat down next to the church’s pastor, the Rev. Clementa C. Pinckney, who was leading a study of the parable of the sower.

When the study group bowed heads for a final prayer, Roof grabbed his handgun, firing 77 bullets in a blaze of gunfire that echoed through the historic black church. Investigators determined that more than 50 of the bullets struck someone, that each victim was hit at least five times.

Roof first shot Rev. Pinckney as others in the Bible study group drove to the floor in fear, seeking cover from the gunfire under round tables where, the prosecutor said, they were summarily executed like animals.The medical examiner concluded that Roof was holding his gun over the victims who were lying still with their arms pulled against them.

The victims were strangers that Roof did not know: Rev. Pinckney, 41, was the senior pastor at the church and a South Carolina state senator. Sharonda Coleman-Singleton, 45, was an assistant pastor at the church and a high school teacher and track coach; Ethel Lee Lance, 70, was a sexton who had worked at the church for 30 years, and her cousin, Susie Jackson, 87, was a longtime Emanuel AME Church member who sang in the church choir; Cynthia Hurd, 54, was a regional branch manager from the Charleston County Public Library system; Myra Thompson, 59, was a church trustee and a retired teacher and guidance counselor who was leading Bible study the night of the shooting. And there was aspiring poet Tywanza Sanders, 26, a 2014 graduate of Allen University. The other victims were Rev. Daniel L. Simmons Sr., 74, a retired pastor who attended Emanuel AME, and Rev. DePayne Middleton-Doctor, 49, an enrollment counselor at Southern Wesleyan University's Charleston campus. Two women and an 11-year-old girl survived the shooting spree.

President Obama addressed the nation the day after the killings, calling them “senseless murders.” He later traveled to South Carolina to deliver the eulogy at Rev. Pinckney’s funeral.

“Any shooting involving multiple victims is a tragedy,” Obama said, adding that “there is something particularly heartbreaking about the death happening in a place in which we seek solace and we seek peace, in a place of worship.” The president said the target of the shootings, “Mother Emanuel,” was particularly troubling not only because it is a place of worship with a rich, lengthy history, but because it has “a sacred place in the history of Charleston and in the history of America.”

Just 17 hours after the massacre, Roof was arrested without incident after driving back roads from Charleston to Shelby, N.C. He immediately confessed in a jailhouse interview with two FBI agents after local police offered him a Burger King hamburger. “Well yeah, I mean, I just went to that church in Charleston and, uh, I did it,” Roof responded to investigators in a filmed interview admitted as evidence during the trial. Pressed for specifics, he added: “Well, I killed them, I guess.”

Roof was subsequently indicted by a South Carolina grand jury on 33 hate-related federal crimes resulting in death. While the federal case moved forward, state murder charges also were filed and are still pending.

The federal trial began on Dec. 7 after Roof was deemed mentally competent to stand trial. Assistant U.S. Attorney Jay Richardson began the prosecution’s case with survivor Felicia Sanders. In gripping detail, she testified that as the gunfire broke, she dove beneath a table, clutching her 11-year-old granddaughter, playing dead on the bloody floor. Sanders told the jury “she swished her legs through the warm blood” of her mortally wounded son, Tywanza Sanders, and aunt Susie Jackson who lay dying beside her so that Roof would think they were dead, the Post and Courier newspaper in Charleston reported.

Sanders said her 26-year-old son stood up, wounded, and pleaded with Roof to stop the gunfire. Roof replied that he had to do this because black people “are raping our women and you all are taking over the world.” Roof then pumped five more rounds into her son, she said. The survivor said her gravely wounded son crawled across the floor to touch his elderly Aunt Susie, who also was fatally wounded. He said he couldn’t breathe and needed water.

Saunders told the jurors she called out to her son, “I love you, Tywanza,” and he responded, “I love you too, Momma” before dying on the church floor.

“I watched my son come into this world, and I saw my son leave this world,” the sobbing survivor told the jury, the newspaper reported.

Testimony also came from FBI Special Agent Joseph Hamski who headed a team of 50 agents who jointly worked the intensive investigation. FBI agents conducted more than 200 interviews and collected more than 500 pieces of evidence, according to various media accounts. The shocking core of the prosecution’s case came when it played for the jury Roof’s two-hour videotaped confession that he gave two FBI agents just hours after his arrest.

When asked how many people he thought he had killed, Roof responded, “Five maybe? I’m really not sure, exactly.” He was dumbfounded when told he had taken nine lives.

“I had to do it because somebody had to do something,” he told the FBI. “Black people are killing white people every day on the street, and they are raping white women. What I did is so minuscule to what they’re doing to white people every day all the time.”

The prosecution closed its case with testimony from the other adult survivor, Polly Sheppard. She testified she was praying out load when Roof pointed his handgun at her feet and told her to “shut up.” The gunman asked Sheppard if she had been shot and she responded “no.”

Roof then said he wasn’t going to shoot her, the Charleston newspaper reported. “I'm going to leave you here to tell the story.”

Roof refused to look at the survivors as they testified, looking downward at the courtroom table where he listened emotionless. He did not take the witness stand, and his defense attorneys called no witnesses on his behalf. Before trial, he had offered to plead guilty in exchange for a life sentence, but that plea bargain was rejected by the U.S. Department of Justice.

Roof’s chief defense attorney, David I. Bruck, acknowledged in closing arguments that his young client was responsible for the “astonishing, horrible attack,” calling his acts abnormal, delusional and suicidal, The New York Times reported. It took the jury only two hours to reach its unanimous guilty verdicts on all 33 counts on Dec. 15.

U.S. District Judge Richard Gergel blocked defense attempts during the six-day trial to introduce testimony or evidence about Roof’s mental state, saying that would be allowed during the penalty phase where mitigating factors can be presented. But that may not happen.Roof has said he will act as his own attorney during the penalty phase set to begin Jan. 3 in front of the same jury panel that now will decide whether he goes to death row or spends the rest of his life in prison.

In a hand-written note filed with the court on Friday, Roof said he “will not be calling mental health experts or presenting mental health evidence” to make a case for mitigating circumstances to forestall a death penalty. In his racist journal introduced as trial evidence, Roof said his doesn’t believe in psychology which he considers a Jewish plot.

“It is a Jewish invention,” Roof wrote, “and does nothing but invent diseases and tell people they have problems when they don’t.”