— -- Nearly two years after Dylann Roof opened fire at a Bible study at a Charleston, South Carolina, church, killing nine black parishioners, the convicted killer pleaded guilty today in state court.
As Roof returned to court this afternoon, here is a look back at the pivotal moments in the Charleston church tragedy.
June 17, 2015: The shooting
The night of June 17, 2015, 21-year-old Roof, who is white, entered the Emanuel AME Church and attended a Bible study, where he was welcomed by the parishioners, according to authorities. Roof then drew his pistol and opened fire, authorities said.
Felicia Sanders, a survivor of the shooting, later testified that when Roof opened fire she clutched her granddaughter tight and told her to play dead.
"I could feel the warm blood flowing on each side of me," she said.
"I was just waiting on my turn," she added. "Even if I got shot, I just didn't want my granddaughter to get shot."
Amid the chaos and the bloodshed, her youngest son, Tywanza Sanders, stood up and confronted the assailant: "Why are you doing this?" he asked, according to Felicia Sanders' testimony.
"And he told our son, 'I have to do this because y'all raping our women and taking over the world,'" Felicia Sanders said. "And that's when [the gunman] put about five bullets in my son.
"We watched him take his last breath," she said of her son. "I watched my son come into this world, and I watched my son leave this world."
After fatally shooting nine people, Roof walked out the door, to his car and fled, leaving the carnage behind him.
June 18, 2015: A suspect is captured
The morning after the massacre, Roof was apprehended at a traffic stop in Shelby, North Carolina, about 245 miles north of the Charleston church.
Roof had a handwritten note in his car with the names of several churches on it, a Confederate flag, a burned U.S. flag, a gun, an empty box of ammunition and a laser attachment for a gun that helps with accuracy, according to authorities.
June 19, 2015: Victims' families offer forgiveness
Less than 48 hours after the shooting, some victims' family members spoke at Roof's first court appearance and offered forgiveness to the 21-year-old.
“I forgive you,” Nadine Collier, the daughter of victim Ethel Lance, said through tears to Roof, who appeared at the bond hearing via video conferencing from jail. "You took something very precious from me and I will never talk to her ever again. I will never be able to hold her again. But I forgive you. And have mercy on your soul."
Anthony Thompson, the husband of victim Myra Thompson, said, "I forgive you. But we would like you to take this opportunity to repent. Repent, confess, give your life to the one who matters most: Christ. So that he can change it, can change your ways no matter what happened to you and you'll be OK. Do that and you'll be better off than what you are right now."
Dec. 15, 2016: A guilty verdict in federal hate crimes case
On Dec. 15, 2016, Roof was found guilty on all 33 counts in his federal trial, including hate crimes resulting in death and obstruction of exercise of religion resulting in death.
During the emotional trial, survivor Polly Sheppard testified that she saw Roof shoot another churchgoer, then she ducked under a table.
Sheppard testified that Roof told her to shut up as she was praying out loud.
Then, she said, Roof asked her whether she was shot. She told him no, she added, and he replied that he wouldn't shoot her. "I’m going to leave you alive to tell the story," Sheppard said Roof told her.
A video interview of Roof conducted by an FBI agent shortly after he was captured was also played in court. In the video Roof laughed as he admitted to the shooting.
In the video Roof said he used a .45-caliber Glock to commit the crime. "I didn't say anything to them before I pulled it out, not even one word," Roof says of the gun in the video. "I mean, they reacted after I shot them."
"I am guilty," he said in the video, laughing.
Defense attorney David Bruck said in court that Roof committed the crime but the trial involves understanding "who this person was and why on earth he would want to cause so much grief."
Jan. 10, 2017: Roof sentenced to death in federal case
The jury's decision had to be unanimous to sentence Roof to death.
The jury spent less than one day deliberating Roof's fate, after Roof told the jurors in a closing statement in the sentencing phase, "I still feel like I had to do it."
In the government's closing argument in the sentencing phase, Assistant U.S. Attorney Jay Richardson said that before the killings, Roof's racist hatred had built up for years. Roof scouted the Emanuel AME Church months before, calling and visiting, Richardson said.
After Roof left the scene of the shooting, Richardson said, he "fully understood the horrific nature" of his crime.
While Roof expressed sorrow to his parents and pity for himself, he didn't shed a tear for the people he killed, Richardson said. Roof showed multiple times that he didn't have remorse, according to Richardson, from his jailhouse manifesto with racist language to the shoes he wore in court during the federal trial that had racist symbols on them.
Roof's defense said in a statement at the time that the "sentencing decision means that this case will not be over for a very long time. We are sorry that, despite our best efforts, the legal proceedings have shed so little light on the reasons for this tragedy."
The defense added that they express sympathy "to all of the families who were so grievously hurt by Dylann Roof’s actions."
Then-Attorney General Loretta Lynch said in a statement, "Roof sought out and opened fire on African-American parishioners engaged in worship. ... He did so because of their race. And he did so to interfere with their peaceful exercise of religion. The victims in the case led lives as compassionate civic and religious leaders; devoted public servants and teachers; and beloved family members and friends.
"No verdict can bring back the nine we lost that day at Mother Emanuel," Lynch continued. "And no verdict can heal the wounds of the five church members who survived the attack or the souls of those who lost loved ones to Roof’s callous hand. But we hope that the completion of the prosecution provides the people of Charleston -- and the people of our nation -- with a measure of closure."
April 10, 2017: Roof pleads guilty in state case
Roof today pleaded guilty to all state charges, including nine counts of murder and three counts of attempted murder, instead of going through a second trial.
Roof's grandfather Joe Roof addressed the court for the first time today, saying "We’re sorry," and adding, "Dylann is not all bad."
"What happened here I will never understand," Joe Roof said. "I will go to my grave not understanding."
Dylann Roof's guilty plea in state court was in exchange for life in prison without the possibility of parole.
Ninth Circuit Solicitor Scarlett Wilson said today that the mission for the guilty plea was to get the "surest path to Dylann Roof's execution" in connection with the federal trial.
Malcolm Graham, the brother of victim Cynthia Hurd, said today, "The sun is shining bright. She is smiling down. Justice was served today."
ABC News' Kristen McFann contributed to this report.