Correction: The editorial incorrectly said that Virginians pay the 43rd-lowest state and local taxes in the nation. They pay the seventh-lowest. The corrected version is below.

SINCE WORLD WAR II, 10 of Virginia’s 11 attorneys general have run for governor. Nine of those 10, Democrats and Republicans alike, resigned to do so, and for good reason: They were loath to politicize an office whose effectiveness and prestige depend on making legal judgments untainted by politics.

Despite that wise precedent, Virginia’s current attorney general, Ken Cuccinelli II (R), has refused to follow suit. He has clung to his position even as he angled for his party’s gubernatorial nomination, bringing a cloud over his office and casting doubt on its ability to act impartially as the state’s legal counsel.

An unfolding example is Mr. Cuccinelli’s maneuvering over Virginia’s landmark transportation bill, awaiting Gov. Robert F. McDonnell’s signature after the General Assembly approved it last month with bipartisan support. Mr. Cuccinelli, a darling of the tea party and an unyielding conservative, opposed the bill because it raises taxes. It’s unfortunate, and irresponsible, that he attacked a bill that he now may be called on to defend.

“In these tough economic times,” he said, “I do not believe Virginia’s middle-class families can afford massive tax increases, and I cannot support legislation that would ask the taxpayers to shoulder an even heavier burden than they are already carrying, especially when the government proposes to do so little belt-tightening in other areas of the budget.”

Put aside his questionable characterizations of the economy (unemployment in Virginia is low, relative to other states, and falling, and the state has been running surpluses), the bill’s effect on taxpayers (as a percentage of personal income, Virginians pay the seventh-lowest state and local taxes in the nation) and the state budget, which is quite lean (general-fund spending is roughly at 2007 levels following years of austerity and cuts).

The real problem is that, by acting simultaneously as the state’s top lawyer and an ideologically committed candidate for governor, Mr. Cuccinelli has put himself, and Virginia, in an untenable position.

Although Mr. Cuccinelli has not yet identified constitutional or legal problems with the transportation bill, others have. Writing in The Post last month, Paul Goldman and Norman Leahy argued that the measure violates Virginia’s constitution by imposing surtaxes in two congested regions — Northern Virginia and Hampton Roads — that would not apply statewide.

If that or another alleged flaw becomes grounds for litigation, then Mr. Cuccinelli, already on record as opposing the bill, will be called on to defend it in court. How vigorously can Virginians expect him to do so? If Mr. Cuccinelli himself identifies a constitutional problem, how would anyone believe that his legal opinion has not been colored by his political thinking?

This sort of quandary is precisely why previous attorneys general chose to resign before running for governor. By refusing to do the same, Mr. Cuccinelli is doing Virginians a disservice and subverting the integrity of his office.