HARRISBURG, Pa. — The map of Pennsylvania’s 18 congressional districts should be thrown out as an unconstitutional gerrymander that unfairly favors Republicans and violates the rights of Democratic voters, a lawsuit filed Thursday says.

The lawsuit, in Pennsylvania’s Commonwealth Court, calls partisan gerrymandering “one of the greatest threats to American democracy today” and suggests Pennsylvania’s district map is one of the worst partisan gerrymanders in the country.

The congressional districts were originally drawn in private by leaders of Pennsylvania’s Republican-controlled Legislature in 2011 and signed as legislation by then-Gov. Tom Corbett, a Republican.

Under that map, Republicans now fill 13 of Pennsylvania’s 18 seats in the U.S. House — or 72 percent — despite winning roughly half of the statewide congressional vote in the last three congressional elections, the lawsuit says.

“The map is basically unresponsive to the will of the people,” said David Gersch of the Arnold & Porter Kaye Scholer law firm in Washington, D.C., which is helping represent the plaintiffs.

Only Texas, California and Florida send more Republicans to the U.S. House than Pennsylvania.

Pennsylvania’s new map underwent dramatic changes, with whole counties and cities moving from one district to another in ways that Democrats said made other districts more Republican friendly.

Districts were contorted into head-scratching shapes for pure, partisan purposes, Gersch said. In one part, the 7th District in southeastern Pennsylvania is no wider than a restaurant in King of Prussia or an endoscopy center in Coatesville, he said.

The 2011 map was the product of a national movement by the Republican Party to entrench its own representatives by utilizing new mapmaking technologies and data to gerrymander districts more effectively than ever, the suit says.

“Republican mapmakers used sophisticated computer modeling techniques, in Pennsylvania and elsewhere, to manipulate district boundaries with surgical precision to maximize the number of seats their party would win in future elections,” according to the lawsuit, the first to challenge the state’s 2011 map.

Independent analyses of recent elections confirm how gerrymandered Pennsylvania’s districts are, the lawsuit says. For instance, applying the “efficiency gap” — a measure of how valuable each vote is — found that Pennsylvania’s gap was the highest in the nation among states that have more than two congressional districts.

Congressional maps in Maryland, North Carolina and Texas are also the subject of gerrymandering lawsuits.

The Philadelphia-based Public Interest Law Center filed the complaint with Arnold & Porter on behalf of the Pennsylvania chapter of the League of Women Voters and a registered Democratic Party voter from each of Pennsylvania’s congressional districts.

The suit asks the court to throw out the map, prevent its use in the 2018 election and create a new map that complies with the constitution, if the state fails to come up with its own in a timely manner. In Pennsylvania, the Commonwealth Court is currently dominated by judges elected as Republicans.

Defendants include many top state officials, including Republicans and Democrats. The top lawyer for Senate President Pro Tempore Joe Scarnati, R-Jefferson, called the lawsuit “baseless” and said Scarnati would fight it. Throwing out the map could disenfranchise millions of Pennsylvania voters and mean changing the rules more than five years after the plan properly became law, said the lawyer, Drew Crompton.

The map drew heavy criticism from most Democrats when it was unveiled, although some Democratic lawmakers voted to approve it. Some Republicans acknowledged at the time that the map was drawn to ensure the re-election of incumbents through the creation of politically safe districts while producing another Republican-held seat.

In 2010, heavy Republican wins flipped a 12-7 Democratic advantage to a 12-7 Republican advantage. A new congressional map is required every decade to reflect population shifts. Because Pennsylvania grew more slowly than the rest of the nation, it lost a U.S. House seat, dropping from 19 to 18 in the most recent map.