In Wisconsin, the Republicans plan to stave off elections went down in flames.

Republican Gov. Scott Walker thought he had the perfect plan to prevent the blue wave from hitting Wisconsin: refuse to allow elections at all.

But his actions led to an epic showdown between all three branches of the state government that finally ended on Thursday morning, when he and his party finally admitted defeat.

After Walker refused to call special elections in Assembly District 42 and Senate District 1, he was sued by voters and election advocates in Dane County District Court, which led to Judge Josann Reynolds — appointed by Walker himself — ordering him to call the elections.

“To state the obvious, if the plaintiffs have a right to vote for their representatives, they must have an election to do so,” said Reynolds.

Furious, Walker’s allies in the legislature immediately began working on legislation to block special elections and make what Walker did retroactively legal. Walker called for a special session to pass it, and asked another Dane County judge, Richard Neiss, to delay the first judge’s ruling so the Republican-controlled legislature would have time to pass the bill nullifying it.

On Tuesday, Neiss refused. “Am I to presume that the legislature is going to pass a bill that immediately affects individuals in unrepresented districts who will have no vote on that bill, that’s going to deprive them of an election?” he asked.

Walker’s attorney general basically argued voters were too stupid and easily confused to vote twice in one year. Neiss, unimpressed, ordered Walker to call the elections by noon on Thursday.

Immediately, Walker appealed to a higher court — which also ruled against him. “The Governor understands he has an obligation to follow the law,” said the District 2 Court of Appeals. “We disagree with the Governor’s assertion that special elections ‘are an unnecessary waste of taxpayer resources and confusing to voters’.”

Finally chastened, Walker decided not to appeal to the state Supreme Court. On Thursday morning, he fired off a tweetstorm blasting “Obama Attorney General Eric Holder and his Washington, D.C.-based special interest group” for forcing him to allow democracy — and announcing the elections will be held on June 12.

At the same time, Wisconsin Senate Majority Leader Scott Fitzgerald announced the legislature would pull its bill to change special election law, saying they were “boxed” in by the state courts.

The irony is that the entire fight was virtually pointless. The legislative session is already over; even if Democrats win the seats, they will not get to vote on any bills and the seats will be up in the fall regardless. So Walker and his allies just spent weeks publicly and embarrassingly fighting to block elections and nullify the state courts over … nothing.

Voters in Wisconsin should remember this saga when they head to the polls in both the special election and the midterms. There is no better demonstration of how little respect Republicans have for accountability or representative democracy in general.