(CNN) The white nationalist convicted of killing nine people at a historically black church in Charleston, South Carolina, believed his prison sentence was irrelevant because he would be freed after a coming race war, his attorneys said in a filing appealing his conviction and death sentence on Tuesday.

"When Dylann Roof represented himself at his capital trial, he was a 22-year-old, ninth-grade dropout diagnosed with schizophrenia-spectrum disorder, autism, anxiety, and depression, who believed his sentence didn't matter because white nationalists would free him from prison after an impending race war," the filing says.

Dylann Roof was convicted of killing nine people at a historic African American church in Charleston, South Carolina.

The argument about Roof's mental stability came as his attorneys asked a federal appeals court to overturn his 2017 death penalty conviction for the 2015 massacre at Mother Emanuel AME Church

In a 321-page motion filed with the 4th US Circuit Court of Appeals, the attorneys wrote that the federal trial court "clearly erred in finding Roof competent to stand trial and sentencing, and it violated his due process rights by holding inadequate competency hearings."

The attorneys argued that Roof was allowed to represent himself at his capital trial despite being mentally incompetent and "disconnected from reality."