The Supreme Court ruled unanimously Tuesday that a Maryland man may proceed with his lawsuit alleging that the state’s congressional redistricting plan was unconstitutionally gerrymandered.

The court said lower courts were wrong to dismiss the lawsuit that Steve Shapiro filed on behalf of himself and others challenging the state’s redistricting after the 2010 Census. The state’s overwhelmingly Democratic political leadership changed the lines to make it easier for Democrats to win in seven of the state’s eight congressional districts.

While Justice Antonin Scalia said the court was not expressing any view on the merits of Shapiro’s suit, he added that his claim “easily clears” the bar set for whether a special three-judge panel should be convened to consider the suit.

A district judge had dismissed the claim, and the U.S. Court of Appeals for the 4th Circuit upheld that decision.

“Perhaps petitioners will ultimately fail on the merits of their suit,” Scalia wrote, but the law “entitles them to make their case before a three-judge district court.”

Shapiro is a longtime scourge of the Maryland General Assembly’s reapportionment efforts, and this year he retired from his job with the federal government to enter law school at American University. He filed the suit on his own but was represented at the Supreme Court by legal counsel.

“The justices had exquisite timing,” said Shapiro, 55. “Finals start tomorrow.”

A spokeswoman for Maryland Gov. Larry Hogan (R) said the suit highlights an unacceptable amount of political influence in Maryland’s redistricting efforts.

“Maryland has the most gerrymandered districts in the nation, and Gov. Hogan has made it very clear that the entire redistricting process needs to be fully reformed,” said Shareese DeLeaver Churchill. “Today’s decision highlights the importance of the governor’s bipartisan efforts to accomplish this reform and ensure that all voters are equally represented.”

In a 2004 decision in Vieth v. Jubelirer, a plurality of the court concluded that after many years of trying, courts had not been able to come up with a test to decide when partisan gerrymandering — as opposed to racial gerrymandering — went too far.

Justice Anthony M. Kennedy agreed with those justices in that case but wrote separately that he did not think that barred “all future claims of injury from a partisan gerrymander.”

Kennedy said he could envision a First Amendment challenge “where a state enacts a law that has the purpose and effect of subjecting a group of voters or their party to disfavored treatment by reason of their views.”

That is what Shapiro is trying to get courts to examine in Maryland.

Scalia said Shapiro’s claim cannot be considered “obviously frivolous” when it is “based on a legal theory put forward by a justice of this court and uncontradicted by the majority in any of our cases.”

And although the court did not express an opinion on Maryland’s districts, it did note that Shapiro was motivated by the “crazy-quilt” results.

Voters have approved Maryland’s redistricting, and lower courts have upheld it against charges of racial gerrymandering. But even when Maryland won, judges noted the contorted handiwork.

For instance, the 3rd Congressional District, now held by Democratic Rep. John Sarbanes (D), has been called one of the most gerrymandered in the nation, roping together voters in Silver Spring, northern Montgomery County, Columbia, Annapolis, the city of Baltimore, and Baltimore County.

U.S. Circuit Judge Paul V. Niemeyer likened it to a “broken-winged pterodactyl, lying prostrate across the center of the state.” It has also been compared to a blood splatter at a crime scene.

Interestingly, Shapiro and the attorney who represented him at the Supreme Court, Michael Kimberly, are Democrats. But if their suit is ultimately successful, it will be Republicans who benefit.

The case is Shapiro v. McManus.

Josh Hicks contributed to this article.