Updated at 3:25 p.m. ETThe Supreme Court has upheld a lower court ruling that struck down two North Carolina congressional districts, saying the state relied too heavily on race in drawing them."A State may not use race as the predominant factor in drawing district lines unless it has a compelling reason," Justice Elena Kagan wrote in the court's opinion. "In this case, a three-judge District Court ruled that North Carolina officials violated that bar when they created two districts whose voting-age populations were majority black." The Supreme Court affirmed that ruling.NPR's Nina Totenberg sums up Kagan's opinion on the two districts at issue in Cooper v. Harris: "In one district, she said that a substantial minority was perfectly able to elect the candidate of their choice. In the second district, the majority agreed with the lower court that the lines had been drawn not on the basis of political affiliation as the Legislature argued, but on the basis of race, which is illegal."The Republican-controlled North Carolina state Legislature redrew the district lines after the 2010 census. Neither had majority black voting-age populations before the redrawing, and both did after. In District 1, in the north-east part of the state, the number of black voters grew to 52.7 percent from 48.6 percent, according to the court. Likewise in District 12, a narrow area in western North Carolina, the number increased to 50.7 percent from 43.8 percent.By boosting the number of black voters in these two districts, The Associated Press wrote, "the result was to weaken African-American voting strength elsewhere in North Carolina."At issue in this case, as Nina has reported, is the relationship between party affiliation and race: "The U.S. Supreme Court has made clear over the past quarter century that racial gerrymandering is an unconstitutional no-no, but partisan gerrymandering is still permissible. The question is: How do you tell the difference? Especially when the Voting Rights Act allows for some consideration of race to ensure minority representation, and when party affiliation often correlates with race." Portions of Kagan's opinion attempt to answer this question "by moving the Court much closer to the position of treating race and party as proxies for one another in the American South," University of California, Irvine, law professor Rick Hasen wrote in a blog post.Justices Clarence Thomas, Ruth Bader Ginsburg, Stephen Breyer and Sonia Sotomayor joined Kagan in the majority opinion. Justice Samuel Alito wrote an opinion agreeing in part and dissenting in part, and he was joined by Chief Justice John Roberts and Justice Anthony Kennedy. Justice Neil Gorsuch was not involved in this case.Alito wrote that the court already had a precedent for District 12, because the justices ruled on it in 2001, when it "had the same basic shape." At the time, a lower court had ruled that the Legislature's main motive in drawing the district was to increase the number of black voters there; the Supreme Court disagreed, in part because the challengers could not produce an "alternative map" that could serve the same political goal "without producing the same racial effects."The districts at issue in the ruling no longer exist. They were hastily redrawn after the federal court ruled against them in February 2016, once again radically altering the map in the state. Republicans still won 10 of the 13 districts in the 2016 North Carolina House election.The Supreme Court's decision is a "major victory for voting rights plaintiffs, who have succeeded in turning the racial gerrymandering cause of action into an effective tool to go after partisan gerrymanders in Southern states," Hasen added."[T]he Court made it clear that it would not allow states to get away with an unlawful racial gerrymandering by claiming that it's just politics," Kristen Clarke, president of the Lawyers' Committee for Civil Rights Under Law, said in a statement. "This is a critical decision as communities prepare for the 2020 redistricting cycle, where states would still be able to purposely create legitimate majority-minority districts, consistent with this opinion."North Carolina Gov. Roy Cooper, a Democrat, applauded the decision: "The North Carolina Republican legislature tried to rig Congressional elections by drawing unconstitutional districts that discriminated against African Americans and that's wrong." Copyright 2017 NPR. To see more, visit http://www.npr.org/.