This Aug. 3, 2017 photo provided by Mississippi Department of Corrections shows Curtis Flowers, who's murder case has gone to trial six times.

The Supreme Court on Friday ruled in favor of Curtis Flowers, a black man in Mississippi who was tried six times by the same prosecutor for a 1996 quadruple murder.

Justice Brett Kavanaugh, who wrote the court's majority opinion, said the trial court committed "clear error" by concluding that the prosecutor's strike of a black juror was not motivated by discrimination.

He said the prosecutor showed a "relentless, determined" effort to rid the jury of black members and try Flowers "ideally before an all-white jury."

"Equal justice under law requires a criminal trial free of racial discrimination in the jury selection process," Kavanaugh wrote in the decision.

The ruling reversing Flowers' conviction was 7-2, with conservative Justices Clarence Thomas and Neil Gorsuch dissenting. Thomas is the court's lone black justice.

The case could now be headed to a seventh trial. Flowers, who is on death row, has consistently maintained that he is innocent of the fatal shootings at the Tardy Furniture store in Winona, Mississippi.

Flowers' lawyers alleged that the prosecutor, Doug Evans, intentionally barred African Americans from the jury pool that convicted him. Three of the victims were white, while the fourth was black. Winona, a town of about 5,000, is majority black.

The Supreme Court held in the 1986 case Batson v. Kentucky that purposeful racial discrimination in the selection of a jury is unlawful.

Evans had barred 41 out of 42 potential black jurors from Flowers' trials, including 5 out of 6 potential black jurors in the sixth trial, the decision Friday noted.

The jury in the sixth trial sentenced Flowers to death, and the Mississippi Supreme Court, which had reversed an earlier conviction on the basis of racial discrimination, this time affirmed the conviction.

Kavanaugh wrote that the court's opinion in Flowers' case broke no new legal ground and was simply applying the Batson decision to "the extraordinary facts of this case."

"The numbers speak loudly," Kavanaugh wrote. "Over the course of the first four trials, there were 36 black prospective jurors against whom the State could have exercised a peremptory strike. The State tried to strike all 36."

Flowers' case was extensively detailed in an APM Reports podcast, "In the Dark," which described the extent of Evans' challenges to prospective black jurors.

The justices had seemed to side with Flowers during oral arguments in March. Those arguments were also notable because Thomas broke his three-year streak of not asking any questions from the bench.

In his dissent, Thomas sharply critiqued the court's decision.

"The majority builds its decision around the narrative that this case has a long history of race discrimination," Thomas wrote. "This narrative might make for an entertaining melodrama, but it has no basis in the record."

Thomas said that the one redeeming quality of the majority ruling was that it left prosecutors "free to convict Curtis Flowers again."

Flowers' lawyer, Sherry Lynn Johnson, called the majority decision overruling the conviction "a victory for everyone."

"The quadruple homicide in this case was a terrible crime, but Curtis Flowers did not commit it," Johnson said in a statement.

"That Mr. Flowers has already endured six trials and more than two decades on death row is a travesty. A seventh trial would be unprecedented, and completely unwarranted given both the flimsiness of the evidence against him and the long trail of misconduct that has kept him wrongfully incarcerated all these years," Johnson said.

In a statement, Mississippi Attorney General Jim Hood said: "The Court has remanded the case for retrial. It will be the duty of the district attorney to re-evaluate the case. If the decision is to retry the case, I am confident the Court's guidance will be followed."

The case is formally known as Curtis Giovanni Flowers v. Mississippi, No. 17-9572.