The Supreme Court ruled Monday that two districts redrawn by North Carolina officials amounted to unconstitutional racial gerrymandering.

The 5-3 decision in Cooper v. Harris tossed out the districts drawn by Republican officials after the 2010 census. Justice Elena Kagan wrote the court's opinion and was joined by Justices Clarence Thomas, who wrote a concurring opinion, and Ruth Bader Ginsburg, Sonia Sotomayor and Stephen Breyer. Justice Neil Gorsuch did not participate.

"We uphold the District Court's conclusions that racial considerations predominated in designing both District 1 and District 12," Kagan wrote for the high court. "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 [measure] 2 of the VRA [Voting Rights Act] gave North Carolina no good reason to reshuffle voters because of their race."

North Carolina's 1st Congressional District is located in the northeastern part of the state, while its 12th Congressional District is in the western and central portions of the state. District 12 includes portions of Charlotte and Winston-Salem.

Justice Samuel Alito wrote a stinging dissent of the high court's opinion that was joined by Chief Justice John Roberts and Anthony Kennedy.

"A precedent of this court should not be treated like a disposable household item — say, a paper plate or napkin — to be used once and then tossed in the trash," Alito wrote. "But that is what the court does today in its decision regarding North Carolina's 12th Congressional District: The court junks a rule adopted in a prior, remarkably similar challenge to this very same congressional district."

Alito's dissent noted that a "critical factor" in the dissenting justices' analysis was that Alito thought those challenging the district as racial gerrymandering failed to provide an alternative map that served the North Carolina legislature's political objective without resulting in the same racial demography in the districts.

Former North Carolina Gov. Pat McCrory conceded the 2016 election to his Democratic opponent, Roy Cooper, the day the case was argued before the Supreme Court. The case's argument was paired with another voting rights case out of Virginia that pitted Marc Elias, a Democratic lawyer who formerly worked for Hillary Clinton's campaign, against Paul Clement, an attorney some conservatives hoped to see considered for the Supreme Court by President Trump. The high court's decision in Bethune-Hill v. Virginia Board of Elections served as a win for Democrats, too, as the Supreme Court struck down 11 of 12 Virginia districts.