The Virginia House of Delegates in Richmond, Va. (Jahi Chikwendiu/Washington Post)

IN VIRGINIA, the incumbent protection racket known as congressional redistricting yielded some odd territorial configurations in 2011. None was odder — or more legally malodorous — than the 3rd District, which stretches along the James River from Norfolk to Richmond.

Now a panel of federal judges, concluding that no amount of nose-holding will give a constitutional gloss to the 3rd’s tortured cartographical lines, has ordered state lawmakers to redraw the boundaries by next spring — or the U.S. District Court for the Eastern District of Virginia will do it for them.

The ruling is unsurprising, given the degree to which the partisan imperative of safeguarding seats for current officeholders has trumped every other consideration in the redistricting process. The results are bizarre-looking electoral maps in which communities are treated with contempt by party bosses looking out for their own interests.

In the view of two of the three judges on the panel, the lawmakers who agreed to the district’s lines in 2011 engaged in racial gerrymandering. Specifically, they packed even more African American voters into what was already the only one of Virginia’s 11 congressional districts with a majority black population and a black incumbent, Rep. Bobby Scott (D). In the process, they left adjoining districts whiter — and safer for Republican incumbents.

For example, state legislators shifted the overwhelmingly black city of Petersburg into Mr. Scott’s district from the neighboring 4th District, represented by Rep. Randy Forbes (R), who is white. By concentrating the electoral clout of African Americans in Mr. Scott’s district, the lawmakers also diluted it in Mr. Forbes’s district, which is now about 31 percent black.

The antidote to such brazen manipulations is nonpartisan redistricting, which has been tried with some success in other states. In Virginia, successive governors have endorsed the concept (albeit with varying degrees of enthusiasm), but lawmakers — generally Republicans — have killed it.

The problem with allowing the status quo to continue is that legislators use it to choose their own voters and engineer uncompetitive elections. In 2008, for example, a bill to establish a nonpartisan redistricting process was killed on a party-line vote in a subcommittee made up of five state lawmakers. All five had been unopposed for reelection the previous fall; little wonder that scarcely a fifth of eligible voters had bothered to cast ballots in those “races.” General elections for Congress have been similarly uncompetitive.

Lawmakers like Del. S. Chris Jones, a powerful Hampton Roads Republican who sits on the General Assembly’s committee overseeing elections, have scoffed at proposals for nonpartisan redistricting. “How would Virginia be better off?” he wondered a few years ago.

Well, Mr. Jones, it might be better off if voters were offered a genuine choice in actual competitive elections in fairly drawn districts. That way, voters could choose their elected representatives, rather than the other way around.