CHARLESTON, SC (WLTX) — The admitted white supremacist responsible for the massacre of nine people inside a Charleston church has plead guilty to state charges against him. 

Dylann Roof appeared in court Monday afternoon, where he entered the plea to murder and attempted murder charges. In exchange for the plea, he'll receive life in prison without parole from the state of South Carolina.

RELATED: Dylann Roof's Friend Gets Over 2 Years in Prison for Lying to FBI

RELATED: Dylann Roof to Plead Guilty to State Murder Charges to Avoid Death Penalty Trial

The action was largely a formality, since Roof had already been sentenced to death at the beginning of the year following his conviction in federal court on murder and other related charges. By taking this option, the state avoids another lengthy trial for a verdict where the outcome was virtually certain, and will begin the process of transferring him to federal custody so he can begin serving time in confinement in a U.S. prison facility. 

During last December's trial, prosecutors showed videos and journals that proved that Roof killed his victims because they were black. The recording and writings showed a man with a deep hatred of African-Americans and other minorities, and who spoke of starting a race war. 

Roof had planned and prepared for the mass shooting by doing things like buying a gun, having target practice in his backyard, researching and studying racist websites and driving to the church several times in the months leading up to the shooting.

Before being sentenced in federal court, Roof was unrepentant, saying “I felt like I had to do it and I still feel like I had to do it."

The victims that night were all in church for a Bible study. Roof sat with them for about an hour, then pulled out his gun and started firing. Three people survived the rampage. 

Roof is expected to be transferred to a federal prison within the next few weeks.