Between November 26th, the day that Honduras held its Presidential election, and December 17th, when the country’s electoral tribunal finally declared a winner, a reported twenty-two protesters were killed; the sister of the incumbent President died in a helicopter crash; and the opposition candidate, who for weeks had declared himself the President-elect, after an apparent upset, had a child. (He tweeted photos from the hospital.) For all the twists in the story, the outcome was nevertheless predictable: the incumbent, Juan Orlando Hernández, an American ally representing the Partido Nacional, which has been in power since 2009, officially won by fifty thousand votes.

The Partido Nacional controls not only the country’s highest court (which contrived to let Hernández run for a second term, despite a constitutional ban on the reëlection of Presidents) but also the national legislature, the military, and the electoral tribunal charged with certifying the results. And yet, on the morning of November 27th, with close to sixty per cent of the ballots tallied, a former telecaster named Salvador Nasralla, who represented a diverse coalition known as the Alliance Against the Dictatorship, emerged with a five-percentage-point lead. One of the four magistrates on the electoral tribunal conceded that Nasralla’s advantage appeared to be “irreversible,” given the distribution of votes. But then the tribunal delayed announcing anything for a day and a half. Its chief magistrate, a longtime Partido Nacional official, appeared before the cameras to offer an explanation for the delay, declaring that slightly more than a million votes still hadn’t been counted. They were being delivered, by hand, to the tribunal’s headquarters in the capital, Tegucigalpa.

The final count was under way by the middle of the week, and, according to the tribunal, Hernández regained the lead. Nasralla and the Alliance appealed to observers from the European Union and the Organization of American States, which alleged significant irregularities. Tens of thousands of protesters took to the streets across the country. The government imposed a curfew and made arrests, but the protests continued. A group of police, who have typically been staunchly pro-Hernández, joined demonstrators in Tegucigalpa. “We’re tired of fighting among ourselves,” one of them told cheering onlookers. “You are the people, and we’re also the people.” The Liberal Party, whose candidate finished third in the Presidential race and acknowledged Nasralla as the winner, joined the Alliance in calling for a recount.

There are about eighteen thousand polling stations in Honduras, about sixteen thousand of which have the technology to scan the vote tallies—called actas—and send them to the electoral tribunal digitally. On election night, around twelve thousand polling places scanned and sent their results, leaving approximately fifty-seven hundred actas unaccounted for. An official working for a company hired by the government to tabulate the ballot data told me, while requesting anonymity, that he and his colleagues found this development disconcerting. “We were in the control room at election headquarters during the day, and we could see on a screen that sixteen thousand polling places were online and ready.” They grew increasingly uneasy as the results came in but the tribunal made no announcement. “We had the data, but the tribunal wasn’t saying anything. We didn’t know what was going on.”

Prior to the election, The Economist obtained a recording that, if valid, suggested that the government had a “Plan B” in place to insure victory for Hernández. It came from someone who claimed to have attended a two-hour training session for Partido Nacional poll workers. On it, a woman who identifies herself as a government employee says that “Plan B means we’re on the offensive.” She goes on to detail what The Economist described as “a scheme for fraudulently boosting the vote of the National Party at the expense of its rivals.” A number of other plans were also mentioned: destroying the bar codes on ballots cast for opposing parties, allowing voters to cast multiple ballots, buying credentials to increase the presence of Party loyalists at individual polling places. (A Party spokesperson said that he was unaware of any such training sessions and questioned the tape’s authenticity.)

Honduran election law tasks representatives of the political parties, as opposed to neutral citizens, with overseeing polling places, and experts have long described the process as being riddled with improprieties. Because the parties are allowed to have representatives at each polling place, they have their own copies of the actas. In theory, if authorities compared the parties’ copies to the tallies published by the electoral tribunal, there would be a way to identify discrepancies. But, according to Rodolfo Pastor, Nasralla’s campaign strategist, neither his party nor the Liberal Party had all of the actas. (Each party had between eighty and eighty-two per cent of them.)

While the ballots were being counted on the Wednesday morning after they were cast, the tribunal’s computer system crashed. The Alliance claimed that the vote was being hacked. According to the official I spoke with, the votes had begun to shift earlier. At the end of Election Day, Hernández had a four-point lead among rural voters. On Tuesday, that lead spiked to thirty per cent before settling, on Wednesday, at twenty per cent. Hernández had claimed that the rural vote would be decisive. But, the official told me, when Nasralla had the lead on Sunday night, with nearly sixty per cent of the vote counted, the actas were being processed randomly, and projections made as part of a “quick count” were based on a sample size that drew, equally, from rural and urban areas. “There’s no logical explanation to say that the votes processed on Sunday versus those processed on Monday, Tuesday, and Wednesday would flip like this,” the official said. “A five-point Alliance lead turned into a 1.2-per-cent advantage for the Partido Nacional.”

On Sunday, just as the tribunal declared Hernández the winner, the O.A.S. issued a report of its own. As the Times reported, observers from the O.A.S. said that “irregularities, mistakes and systemic problems plaguing this election make it difficult” to be “certain about the outcome.” Accordingly, the head of the O.A.S. had asked the electoral tribunal not to announce a winner because “serious doubts about the results persisted.” When it did, the O.A.S. called for new elections.

Washington is caught in a characteristic tangle. On November 28th, while the electoral tribunal equivocated, Secretary of State Rex Tillerson signed a document confirming that the Hernández government had qualified for more aid money. It had done so even though qualification required the government to meet twelve conditions, including that it “combat corruption” and “protect the right of political opposition parties . . . and civil society activists to operate without interference.” A few days later, Heide Fulton, the American chargé d’affaires, who had spent the previous week encouraging calm as the votes were being counted, appeared beside the chief magistrate of the electoral tribunal. The Trump Administration had indicated, at first, that the O.A.S.’s determination would be definitive and that the United States would support it, but many questioned the Administration’s impartiality. “The U.S. kept supporting the tribunal, but it had completely lost its legitimacy,” Pastor told me.

If the Trump Administration does accept the recommendations of the O.A.S., it would be nullifying the election of an ally, Hernández, whose cabinet is currently accusing the O.A.S. of “robbing the vote,” “conspiring” with Nasralla, and “fomenting violence in Honduras.” Juan González, a top adviser on Latin America to the Obama Administration, told the Times that the question is now: “Will the United States remain consistent in defending the electoral process, regardless of whether the country in question is friend or foe . . . or equivocate when the process breaks down in a country that cooperates with the United States?”

That question may sound familiar. In 2009, the U.S. looked the other way when a cadre of generals and right-wing politicians in Honduras launched a coup to overthrow a sitting President. Hernández was one of the plotters.