The 2012 shooting of Trayvon Martin -- the black Florida teen killed by George Zimmerman, who was acquitted of murder -- prompted Roof to research online what he called "black on white crime," the manifesto said.
"At this moment I realized that something was very wrong," the manifesto said. "How could the news be blowing up the Trayvon Martin case while hundreds of these black on White murders got ignored?"
Toward the end of the 2,000-word text, under a section titled "An Explanation," the writer hints at why Charleston was targeted.
"I have no choice," Roof wrote. "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. Well someone has to have the bravery to take it to the real world, and I guess that has to be me."
The website, called "The Last Rhodesian," is registered to Roof and lists him as its administrator. In an image tweeted by South Carolina authorities this week, Roof is seen wearing a jacket with the flags of apartheid-era South Africa and nearby Rhodesia, a former British colony that a white minority ruled until it became independent in 1980 and its name was changed to Zimbabwe.
Images on the website include a .45-caliber Glock pistol; Roof taking aim with the gun, and posing in front of a sign that says, "Sacred burial site. Our African ancestors" as well as outside South Carolina's Museum and Library of Confederate History; and Roof standing on and burning an American flag.
The contents of the website appear to back up what friends have said about the young man who Saturday sat in his jail cell under suicide watch.
A drunken Roof boasted one night about an unspecified six-month plan "to do something crazy," his friend Joey Meek told CNN on Friday.
The young man typically kept to himself but a liter of vodka that night seemed to fuel talk about the return of segregation and vague plans "to start a race war," Meek recalled.
"He wanted it to be white with white, and black with black," Meek said. "He had it in his mind, and he didn't really let nobody know (what he was going to do)."
Meek hid Roof's gun that night but put it back the next day, he said. "I didn't take him serious."
Meek didn't take his claims to authorities before Thursday morning, the day after nine people were killed at Emanuel African Methodist Episcopal Church
"Dylann wasn't a serious person; no one took him serious," Meek said. "But if someone had taken him serious, this all would all have been avoided."
Roof has been charged with nine counts of murder
and possession of a firearm during the commission of a violent crime.
On Friday, Roof was expressionless, almost solemn, as he appeared via video before Magistrate James Gosnell Jr., who opened a bond hearing by saying that there were victims on the young man's side of the family as well. The judge set a $1 million bond on the possession of a firearm count but no bond on the murder charges.
Roof almost inaudibly answered questions about his age, address and employment.
He showed no emotion as family members of his victims addressed the court and Roof, expressing both anger and forgiveness.
"I will never be able to hold her again, but I forgive you," a daughter of Ethel Lance said. "And have mercy on your soul. You hurt me. You hurt a lot of people, but God forgives you, and I forgive you."
Felecia Sanders, mother of victim Tywanza Sanders, said that "every fiber in my body hurts, and I will never be the same."
"As we said in the Bible study, we enjoyed you," she said of Roof's time at the church before the massacre. "But may God have mercy on you."
Police caught Roof in Shelby, North Carolina, about 245 miles away from the carnage in Charleston.
He confessed to the shootings in interviews with the Charleston police and FBI, two law enforcement officials told Evan Perez and Wesley Bruer of CNN, the first network to report this development. He also told investigators he wanted to start a race war, one of those officials said.
Police are investigating the shooting as a hate crime.
The wedding of Roof's sister, planned for this weekend, has been postponed, according to the Rev. Tony Metze, pastor of St. Paul's Lutheran Church in Columbia, South Carolina.
Metze said he met with Roof's immediate family on Friday.
"What they've asked and what I ask is that we continue to hold all these families in our prayers," Metze told CNN. "And that the whole world, our nation, Charleston, our community understand that we love them. God loves them."
Friends and family
Family members and friends of Roof who spoke to CNN painted a picture of a childhood and adolescence that was perhaps troubled, but there was nothing to indicate that he'd grow up to be accused of such a horrific hate crime.
"That's why all this is such a shock," said John Mullins, who attended White Knoll High School with Roof.
Dylann Roof spent his early years shuttling back and forth between his mother and father, who had divorced in 1991, four years before he was born, according to court documents.
When it came to school, he struggled -- and his attendance was poor. Roof was "very transient," said one White Knoll High School official. "He came and went." Roof flunked the ninth grade twice before dropping out.
Mullins told CNN that Roof was "kind of wild" but he wasn't violent. He was a heavy drinker, and liked to smoke marijuana, but he also dabbled in a harder variety of drugs. In February, he was arrested at a local mall for possession of Suboxone -- medication used to treat heroin addiction -- because he didn't have a prescription for it.
As far as a burgeoning streak of racism, Mullins recalled Roof occasionally making racist comments, but said he had black friends at the same time.
"They were just racist slurs in a sense," he said. "He would say it just as a joke. ... I never took it seriously, but now that he shed his other side, so maybe they should have been taken more seriously."
The months leading up to the shooting were a mix of troubling and odd. The Suboxone episode got him banned from the Columbiana Centre mall for a year, but Roof nevertheless returned April 26, prompting another arrest, and this time, a three-year ban from the mall.
Before opening fire
Roof spent about an hour at the historic African-American church before the massacre, attending the prayer meeting with his eventual victims
, Charleston police Chief Greg Mullen said.
Witnesses told investigators the gunman stood up and said he was there "to shoot black people," a law enforcement official said.
He answered one man's plea to stop by shooting him, said Sylvia Johnson, a cousin of the church's slain pastor who has talked to a survivor.
"'No, you've raped our women, and you are taking over the country," he said, according to Johnson. "... I have to do what I have to do."
All the victims were shot multiple times, according to Roof's arrest warrant.
"Prior to leaving the bible study room he stood over a witness ... and uttered a racially inflammatory statement," the warrant said.
Investigators are looking into whether Roof had links to white supremacist or other hate groups, a law enforcement official said. There's no indication so far that he was known to law enforcement officials who focus on hate groups.
Roof turned 21 in April, and a short time later he had a gun.
On Thursday, investigators did a trace of the handgun used in Wednesday's shooting and determined that it was a .45-caliber handgun Roof purchased from a Charleston gun store in April, two law enforcement officials told CNN's Perez and Bruer.
Roof purchased a Glock .45-caliber model 41, which holds 13 rounds, a federal law enforcement source with knowledge of the investigation said. Witnesses have reported that Roof reloaded a number of times.
Roof's father and uncle contacted police after surveillance camera images of the suspect were made public, according to the arrest warrant. His father told authorities his son owned a .45-caliber handgun.
Joe Roof, his grandfather, said Roof was given "birthday money" and that the family didn't know what he did with it.