Washington (CNN) Arkansas' Supreme Court justices are suddenly finding themselves on the other side of the bench -- as defendants -- in a new federal lawsuit brought by a judge in the state alleging religious and racial discrimination over death penalty cases.

Arkansas Circuit Judge Wendell Griffen, who has been twice elected to the office, filed the suit in federal court on Thursday, suing the Arkansas Supreme Court over its decision to pull him off of all death penalty cases.

At issue is an April move by the court to bar Griffen from being assigned any death penalty cases. In the days leading up to the decision, Griffen, who is a Baptist pastor, participated in a Good Friday rally against the death penalty, during which he was photographed lying on a cot as part of the demonstration. He also wrote a blog post that week stating his belief that the death penalty was not morally defensible -- though his lawsuit points out that he did not argue it was legally indefensible.

Judge Wendell Griffen lies on a cot at an anti-death penalty demonstration outside the Governor's Mansion in Little Rock, Arkansas on April 14, 2017. (Sherry Simon via AP)

The next day, Griffen issued an order halting the execution of nine inmates in a case brought by a drug manufacturer, which asked for the move because it said its drug was never intended to be used in capital punishment. The Arkansas attorney general appealed to the state supreme court to overrule Griffen.

Instead, the court took the broader step of reassigning all of Griffen's death penalty cases, citing Arkansas code on judicial conduct.

"Judges should maintain the dignity of judicial office at all times, and avoid both impropriety and the appearance of impropriety in their professional and personal lives," the code states. "They should aspire at all times to conduct that ensures the greatest possible public confidence in their independence, impartiality, integrity, and confidence."

The court referred the matter to a disciplinary commission to investigate further. One justice concurred with the decision in part, but said the court's move to permanently reassign all of Griffen's cases without investigating first was too much.

The attorney general's office declined to comment and the state supreme court did not respond to a request for comment.

Now Griffen is asking the federal courts to overturn his state's top court, alleging that he is being discriminated against for his faith and race, as an African-American.

Griffen's lawyers argue first that his protests were an exercise of his First Amendment rights to free speech and freedom of religion. They argue that he took part in the protests in his personal capacity, and didn't wear his robes or otherwise invoke his judicial role. They also challenge the decision on due process grounds, arguing Griffen did not have a chance to argue his case in court.

The lawsuit also lists a number of white judges who engaged in criminal behavior, who the attorneys argue were treated more fairly or less severely than Griffen, an African-American judge who has not been accused of criminal activity.

The lawsuit also notes that Griffen has allowed the death penalty to proceed in court cases before, and a judge that took over the drug manufacturer case after him arrived at a similar conclusion.

One of Griffen's attorneys, Mike Laux, praised in an emailed statement his' "courage, intellect and fortitude."

"Suffice it to say he is a remarkable man and thoughtful judge, and I could not be prouder to represent him," Laux said. "The Arkansas Supreme Court and other 'powers that be' have had it out for him for years because of his much-needed outspokenness on dire social issues in a state with a miserable history of protecting the disadvantaged and marginalized, especially those of color. The court and various state legislators have truly gone too far this time, and we intend to prove it."

University of Chicago law professor Geoffrey Stone, an expert on the First Amendment, says that public employees are held to different standards than private citizens, and thus may have their First Amendment speech rights curtailed, for example a teacher being restricted in what he or she could say in front of students.

But, he said, the case will likely come down to whether it's true that what Griffen said and did undermines his ability to do his job.

"You have to show that the speech was directly incompatible with his functions. It's not clear that anything he said was not compatible with his functioning," Stone said. "My own view would be to say he's perfectly within his rights to say the death penalty is immoral. As long as he is applying the law fairly, judges criticize the law all the time."

The case will be heard in the Eastern District of Arkansas.