John Benisek, left, and Steve Shapiro, are two of the three Maryland residents who initially sued, claiming the state’s congressional districts violated the First Amendment. (Jessica Gresko/AP)

A lawsuit challenging Maryland’s contorted congressional district map on First Amendment grounds has merit and should go forward, a three-judge federal panel ruled Wednesday.

The map, drawn by Maryland’s Democratic lawmakers following the 2010 Census, essentially ensured that seven of the state’s eight congressional seats would be under their party’s control.

According to the lawsuit, the redistricting specifically targeted western Maryland’s 6th District, where lines were altered to help unseat 10-term incumbent Rep. Roscoe G. Bartlett (R). Bartlett was defeated by John Delaney (D) in 2012.

The suit, brought by Steve Shapiro, an American University law student, presents a novel argument: that the gerrymandered map violated the rights of 6th District Republican voters to political association and expression. It asks that the state be barred from using the map in any future elections.

The suit was thrown out by a federal judge in 2014. But the Supreme Court ruled in December that Shapiro should have gotten a hearing before a three-judge panel. The case was sent back to federal district court and heard last month in Baltimore.

Wednesday’s 2-to-1 decision will have no impact on November’s congressional elections.

The three-judge panel denied the state’s motion to dismiss the case, which will be tried sometime in the next several months, before the same judicial trio.

Michael Kimberly, Shapiro’s attorney, said that if his client prevails at trial, and the case ends up back in the Supreme Court, it could eventually bring sweeping changes to redistricting across the country.

“This could be the biggest gerrymandering case in a generation,” Kimberly said. “It could have enormous impact.”

Maryland Gov. Larry Hogan (R), who has called for a nonpartisan commission to draw congressional and state legislative districts, called the ruling “a tremendous step forward in the fight for free and fair elections.”

“Redistricting reform is not a partisan issue but an issue that all Marylanders — Democrats, Republicans, and Independents — should embrace and actively push to enact,” the governor said in a statement.

While the Supreme Court has been active in enforcing the Voting Rights Act, which bars racial gerrymandering, it has not definitively addressed partisan gerrymandering. The reason, Justice Antonin Scalia said in writing for the majority in the 2004 case Vieth v. Jubelirer, is that it is difficult to devise a test to determine when lawmakers have gone too far in adjusting district boundaries for partisan advantage.

In a concurring opinion, Justice Anthony M. Kennedy left the door ajar for a challenge to redistricting based on the First Amendment, if plaintiffs can prove that redistricting created “disfavored treatment” of groups because of their voting preferences.

Shapiro and Kimberly picked up on Kennedy’s suggestion.

Fourth Circuit Judge Paul V. Niemeyer, writing for the majority in Wednesday’s ruling, said the First Amendment argument has never been rejected by the Supreme Court in past gerrymandering cases. He said that the complaint “adequately employs First Amendment jurisprudence to state a plausible claim for relief.”

U.S. District Judge George L. Russell III also sided with Shapiro. U.S. District Judge James K. Bredar, who threw out the case in 2014, remained opposed to the lawsuit.

At trial, Shapiro and Kimberly will have to present hard evidence that Maryland officials looked at party affiliation and voting histories of 6th District voters and took that information into account in drawing the map.

Kimberly said Wednesday that members of the General Assembly and the redistricting committee created by then-Gov. Martin O’Malley (D) were quite transparent about their goals.

“All of the major actors in this case were all pretty straightforward on the public record about what they did, and how they did what they did,” Kimberly said.