What at one point looked like a big primary night victory for Rep. Charlie Rangel (D-N.Y.) has gradually become a close race — enough so that Rangel’s opponent is now filing for a possible do-over election.

State Sen. Adriano Espaillat this week filed with the state Supreme Court seeking either a recount or a highly unusual redo of his June 26 primary with Rangel. Espaillat has lodged accusations of voter suppression and has pointed to faulty administration and vote-counting by New York City elections officials.

Rep. Charles Rangel, D-N.Y., salutes surviving members of the Montford Point Marines, during a Congressional Gold Medal ceremony at the U.S. Capitol in Washington, Wednesday, June 27, 2012. (Pablo Martinez Monsivais — Associated Press)

The race appeared over and done last Tuesday night, with Rangel holding a double-digit lead in early returns. He delivered a victory speech, and Espaillat conceded.

As the night wore on, though, Espaillat closed the gap significantly, and a continuing manual counting of the ballots now has Rangel up just 802 votes out of nearly 40,000 cast. A couple thousand absentee ballots still have yet to be counted.

At this point, Espaillat is fighting what is very much an uphill battle, and it’s unlikely he’ll overtake the 42-year incumbent, who has suffered from ethics charges and a redistricting process that made his district majority-Hispanic (Espaillat is Dominican-American). But emerging questions about the vote-counting process are keeping the state senator in the game.

Barring the uncovering of some previously uncounted or miscounted votes, Espaillat is not going to creep much closer than the 2 percent margin he currently trails by. While 800 votes doesn’t sound like much, it’s a lot in a low-turnout primary, and in basically every state, it’s well outside the margin under which a candidate can even ask for a recount, much less a re-vote.

A re-vote is much rarer and would require two things, according to a Wall Street Journal report: 1) That there is significant evidence of some kind of irregularity, and 2) That the irregularity could be enough to swing the result of the election.

From the Journal’s report:

A razor-thin margin, alone, isn’t enough to warrant a do-over. Under state election law: “The court may direct reassembling of any convention or the holding of a new primary election, or caucus where it finds there has been such fraud or irregularity as to render impossible a determination as to who rightfully was nominated or elected.”

Election experts are hard-pressed to come up with recent example of primary redos. There’s the case of Brooklyn Assemblyman Jim Brennan, a Democrat who was first elected in a redo vote in 1984 after a judge ruled that the first contest — with just two votes separating him from his challenger — was too close to call.

Given that Espaillat currently trails by 2 percent of the vote — much more than two votes — there would need to be significant provable irregularities for it to even be possible for him to have won. (Espaillat has also alleged voter suppression, but that is not grounds for a re-vote.)

That’s a very high legal bar for Espaillat’s campaign to clear, and the lack of previous redos demonstrates that fact.

Rangel, for his part, is criticizing Espaillat for dragging things out. In a news conference Wednesday in Harlem, he urged his opponent to drop his case.

“You can’t just call people crooks and say that they’re committing illegal acts,” Rangel said, according to the New York Daily News. Rangel added: “Don’t knock the system; it’s all we have.”

Espaillat’s campaign, for now, is exercising all its options, as any good campaign would do. It had to file for the re-vote within 10 days of the primary, so the move this week seems precautionary rather than a silver-bullet strategy.

But he’s got some backup when it comes to questioning the vote-counting process. New York City Public Advocate Bill de Blasio (a likely 2013 mayoral hopeful who was notably endorsed by Rangel in his last campaign) has written a letter expressing concerns about the vote-counting process in the Rangel primary.

“I am disturbed by reports that may point to a larger set of election administration issues in our city,” de Blasio wrote. “In particular, I am concerned by the election night vote tallying process in which only hand-written canvas sheets, prepared by poll workers and then reported to the New York City Police Department, are used for totaling election night vote returns, instead of using vote count print-outs directly from precinct voting machines.”

De Blasio then asks a series of questions about the city’s vote-tallying process.

The high-profile questioning of the city’s elections board’s processes will certainly help Espaillat, but a tough court battle remains.

Stay tuned to The Fix for all the major goings-on in this unfolding drama.