A divided Minnesota Supreme Court ruled today that wrongly rejected absentee ballots should be counted in the U.S. Senate race. But the process ordered by the three-justice majority mandates that the campaigns of Sen. Norm Coleman and Al Franken agree that a ballot was improperly invalidated before it is included in the final tally.

The opinion was authored by Judge Helen Meyer, with justices Lorie Skjerven Gildea and Christopher Dietzen joining her in the majority. Justices Alan Page and Paul Anderson wrote strongly worded dissents, arguing that the ruling is inconsistent and inadequate for ensuring that every properly cast vote is counted.

The majority opinion concludes that local election officials do not have the authority under Minnesota law to amend their vote tallies to include improperly rejected absentee ballots. However, it then orders the two campaigns, the Secretary of State’s office and all county canvassing boards to create a process for determining which ballots were wrongly invalidated. If all parties agree that a ballot should be included in the final tally it will be counted. The ruling states that this process must be concluded by 4 p.m. on Dec. 31.

Roughly 1,500 absentee ballots may have been improperly rejected by local elections officials. With the race extraordinarily tight, the dispute over such ballots could ultimately determine the outcome of the contest.

Justice Page offered a blistering critique of the majority opinion. After first quoting Joseph Stalin (”I consider it completely unimportant who … will vote, or how; but what is extraordinarily important is this — who will count the votes and how”), he argued that the court’s ruling will disenfranchise voters. “The court’s order may seek the peaceful way out by asking the campaigns to agree on improperly rejected ballots,” Page wrote. “But the order does not guarantee that the candidates and their political parties will agree on any rejected ballot. Instead the court’s order will arbitrarily disqualify enfranchised voters on the whim of the candidates and the political parties without the benefit of the legislatively authorized procedures” under state law.

Justice Anderson countered with a quote from British playwright Tom Stoppard (”It’s not the voting that’s democracy, it’s the counting”) and was only slightly more reserved in voicing his disagreement with the ruling opinion. “I conclude that the majority’s opinion is flawed because it misreads Minnesota’s election laws, is internally inconsistent, and has essentially inserted this court into a political thicket based on a premise that lacks a basis under the law,” he wrote.

Despite the ruling’s convoluted prescription for including wrongly rejected absentee ballots, the Franken campaign praised the court’s actions. “We are pleased that the Supreme Court has rejected Norm Coleman’s attempt to win re-election by throwing out the lawful votes of Minnesotans who did everything right,” Marc Elias, the Franken campaign’s lead recount attorney, said in a statement.

The Supreme Court ruling came at the end of another long day before the state canvassing board. The five-member panel plowed through 642 contested ballots, providing a considerable boost to the Franken campaign. According to the Star Tribune’s independent analysis, the Democrat pulled to within just five votes of the incumbent — down from a 360-vote difference at the start of the day. With roughly 400 ballots still to be considered by the canvassing board, and the bulk of them being challenges lodged by the Coleman campaign, it appears likely that Franken will be ahead when this stage of the recount concludes. (The overwhelming majority of challenges have so far been rejected by the five-member panel.)

The canvassing board must still wrestle with one thorny matter: what to do about ballots that the Coleman campaign believes were counted twice. The canvassing board debated the question at the close of today’s session and seemed strongly inclined to avoid the quagmire of determining whether both duplicate and original ballots were counted in some instances. “I am terribly uncomfortable placing my imprimatur on something that I think basically requires more facts than I’ve got,” said Eric Magnuson, Chief Justice of the Minnesota Supreme Court and a member of the canvassing board.

The panel will make a final ruling on the matter when they reconvene tomorrow morning. But this issue (like so many others in the arduous recount process) looks like it will ultimately end up in the courts.

Regardless of what happens, Secretary of State Mark Ritchie vowed that the canvassing board will finish ruling on disputed ballots tomorrow. “People have agreed to stay until we’re done,” he said.