Maryland’s infamously contorted congressional district map was challenged in federal court on Tuesday by an American University law student who says the boundaries violate the First Amendment rights of Republican voters.

The suit was thrown out by a federal judge in 2014, a decision upheld by the U.S. Court of Appeals for the 4th Circuit. But the Supreme Court ruled in December that plaintiff Stephen Shapiro was improperly denied a hearing before a three-judge panel. He got his day in court in Baltimore on Tuesday, along with plaintiffs in two other lawsuits challenging Maryland’s 2011 redistricting.

[D.C. law student takes Md gerrymandering case to Supreme Court]

Shapiro questions the legality of gerrymandered boundaries approved by Democratic state lawmakers to ensure that seven of Maryland’s eight congressional seats would be under their party’s control.

A specific priority, the suit alleges, was the reconfiguring of western Maryland’s 6th District to oust 10-term Rep. Roscoe G. Bartlett (R), who lost his seat the next year to John Delaney (D).

State attorneys have filed a motion to again dismiss Shapiro’s case. But should two of the three judges buy into Shapiro’s argument, Maryland’s political map could soon be back before the Supreme Court.

Unlike racial gerrymandering, which is barred by the Voting Rights Act, partisan gerrymandering has not been definitively addressed by the nation’s highest court.

In the 2004 case Vieth v. Jubelirer, Justice Antonin Scalia, writing for the majority, concluded that it was impossible to come up with a sensible test to decide when lawmakers had gone too far in manipulating boundaries for partisan advantage.

But in a concurring opinion, Justice Anthony M. Kennedy suggested that the First Amendment could be the basis for a challenge if plaintiffs could prove that redistricting created “disfavored treatment” of groups based on their voting preferences.

Shapiro and his attorney, Michael Kimberly, are attempting to slip through the door Kennedy left ajar.

They assert that the map drawn by Democratic lawmakers violated the rights of Republican voters to political association and expression by expressly targeting 6th District voters, who had long expressed their preference for Republican candidates.

[Supreme Court says challenge of Maryland district lines can proceed ]

Kimberly said the sheer scale of the redistricting — swapping an estimated 360,000 residents from the heavily Republican 6th District for a similar number of voters from the deep-blue 8th District, centered in Montgomery County — made it all but inevitable that Democrats would win both seats.

“The results were crushingly effective,” Kimberly said in his written argument to the panel. In the 6th District, Bartlett’s share of the vote plummeted from 61 percent in 2010 to 38 percent in 2012.

Shapiro and Kimberly are seeking an injunction barring Maryland from using the map.

Maryland Assistant Attorney General Jennifer L. Katz defended the district boundaries, arguing that the redrawn map posed no such harm to Maryland residents, who are able to vote, campaign and express their opinions as they please.

Katz said that party preference can take unexpected turns from election to election. She noted that Gov. Larry Hogan, a Republican, recently announced that he would not vote for his party’s presumptive presidential nominee, Donald Trump. She also pointed out that in 2014, Delaney nearly lost his 6th District seat to Republican Dan Bongino.

But Kimberly and Shapiro had a highly sympathetic ear in one member of the judicial panel: 4th Circuit Judge Paul V. Niemeyer. He wrote in a 2011 opinion that Maryland’s 3rd Congressional District, which takes in parts of Montgomery, Howard and Baltimore counties and Baltimore City, resembled a “broken-winged pterodactyl, lying prostrate across the center of the state.”

Niemeyer peppered Katz with questions and corrections during her oral argument. He branded as “too simplistic” her contention that the only damage to 6th District Republicans is that they are no longer certain to elect the candidate of their choice.

Niemeyer said the scope of the population shift between the 6th and 8th districts had only one objective: to dilute the impact of Republican voters.

“It’s hard not to say that’s what was going on,” he said.

[Md. Gov. Larry Hogan (R) really wants redistricting reform]

The two other justices on the panel were U.S. district judges James K. Bredar — who originally dismissed Shapiro’s suit — and George L. Russell III.

The other two lawsuits, also given another turn at the wheel because of the Supreme Court’s December decision, challenged the Maryland map from different directions.

Judicial Watch, a conservative legal foundation, argued that the state’s “egregious” gerrymandering could be stopped by ensuring that all congressional districts are physically compact without regard to partisan makeup. Attorney Robert Popper proposed a mathematical formula he developed with law professor Daniel D. Polsby to form more compact districts.

Maryland Assistant Attorney General Jeffrey L. Darsie, arguing to dismiss the case, said it was not realistic to expect that district boundaries could be drawn without some underlying political strategy.

“As long as legislators are responsible for drawing districts . . . the decisions will inevitably and unavoidably include political calculations,” Darsie said.

The third suit was brought by Christopher Eric Bouchat, a Carroll County resident who contends that the division of his state legislative district across county lines violates his constitutional rights.

Bouchat brought an earlier version of the suit in 2012 that was thrown out by the Maryland Court of Appeals. This time Bouchat cited his unsuccessful 2014 Republican primary race for the House of Delegates in District 9A, which includes mostly Howard County residents and only a small portion of Carroll voters. He said the boundaries effectively disenfranchise Carroll voters.