Virginia Attorney General Mark Herring. (Joe Mahoney/AP)

FOR MORE THAN three years, the state of Virginia has been defending the indefensible: a highly gerrymandered and racially suspect legislative voting map, approved in 2011 by Republicans in the state’s House of Delegates. The state’s arguments that the map passed constitutional muster never passed the smell test, given that GOP lawmakers, who drew the House district lines in 2011, had been fairly obvious from the outset about what they were up to: packing as many African American voters as they could into as few districts as possible.

Last month, a panel of federal judges said as much, and, in the wake of that ruling, Virginia Attorney General Mark R. Herring said the state would no longer defend the map. It’s the right call.

Determining how much gerrymandering is too much, and parsing the racial implications of voting maps, are exceptionally tangled areas of law. In this case, however, it’s clear lawmakers unconstitutionally used race as the primary yardstick in drawing 11 voting districts in Hampton Roads and around Richmond — in each case marking the lines so that blacks would constitute at least 55 percent of eligible voters in the relevant districts.

The map was overwhelming approved by the House, including by black (and by most white) Democrats for whom, as for Republicans, it amounted to an incumbent-protection plan. However, the effect of that arbitrary 55 percent threshold — which was more than needed to elect black and Democratic candidates in some districts — was also to diminish the presence and electoral power of black voters in adjacent districts, thereby keeping many of those safe for Republicans. Had Republicans wanted, some Democrats pointed out at the time, they could have drawn two additional majority-minority districts; unsurprisingly, they chose not to do so.

Mr. Herring, a Democrat, stands accused of refusing to defend the law for partisan reasons. That’s unfair. It’s true that letting stand the federal court’s ruling, which directs the legislature to redraw the legislative map by Oct. 30, is highly likely to help Democrats in 2019, when the next elections take place for the House of Delegates. It’s also true that Virginia Republicans, whose 2-to-1 majority in the House was chopped to a two-vote margin in last fall’s elections, justifiably fear the political momentum is against them.

That’s not adequate reason for the state to throw good money after bad by continuing to make the case for a dubious map, which Virginia has already spent nearly $900,000 defending. Having reviewed the federal court’s 93-page decision, Mr. Herring reasonably concluded that the ruling — in a case that has already been to the Supreme Court and back down to lower courts — is unlikely to be reversed on appeal. Better, he said, for the legislature to get on with redrafting the map. Gov. Ralph Northam, also a Democrat, agreed.

Republicans, clinging to a 51-49 majority in the House of Delegates, would be wise to heed that advice. For now, they are pressing their own appeal, hoping to persuade the Supreme Court to uphold the current map. If they succeed in delaying things but wind up with the same result, it may be Democrats who, if they pick up just two more House seats in 2019, wield the power to redraw the map.