The Supreme Court of the United States (SCOTUS) issued a ruling today (May 22) that the Republicans who control North Carolina’s legislature illegally used race to draw congressional districts in the state. The United States Court of Appeals for the Fourth Circuit previously found that the same body created voter ID laws that targeted Blacks with “almost surgical precision.” SCOTUS recently refused to hear a challenge to that decision.

In Cooper v. Harris, North Carolina voters sued state officials, alleging “impermissible racial gerrymanders.” Gerrymandering is when voting district boundaries are drawn to provide an advantage to a particular political party.

The suit stemmed from the officials’ redrawing of two congressional districts following the 2010 census. Before the redistricting, both Districts 1 and 12 consistently elected candidates that were preferred by Black voters, despite the fact that neither district had a majority Black voting pool. After the census, the map was redrawn to make those districts predominantly Black. The United States District Court for the Middle District of North Carolina found that the districts were in violation of the Fourteenth Amendment’s Equal Protection Clause, which prevents states from denying citizens equal protection under the law.

The state appealed the case to the Supreme Court, and SCOTUS voted 5-3 to uphold the previous decision, ruling the gerrymandering unconstitutional. The majority opinion was written by Justice Elena Kagan, who was joined by Justice Ruth Bader Ginsburg, Justice Stephen Breyer and Justice Sonia Sotomayor. Justice Clarence Thomas wrote a concurring opinion.

From Kagan’s opinion:

Applying a clear error standard, we uphold the District Court’s conclusions that racial considerations predominated in designing both District 1 and District 12. For District 12, that is all we must do, because North Carolina has made no attempt to justify race-based districting there. For District 1, we further uphold the District Court’s decision that §2 of the VRA gave North Carolina no good reason to reshuffle voters because of their race. We accordingly affirm the judgment of the District Court.

Justice Samuel Alito wrote the dissenting opinion, which was joined by Justice Anthony Kennedy and Chief Justice John Roberts. New justice Neil Gorsuch was not on the court when the case was heard in December, so he did not weigh in.

Thomas’ decision to join with the liberal justices on the court did not go unnoticed. His name was a trending topic on Twitter today, as users posted about their surprise.