The election has turned into a showdown between former TV entertainer Salvador Nasralla and President Hernandez who is going for four more years in office despite a constitutional limit of just one term.
The result of Honduras' presidential election remained in limbo on Wednesday, with a gregarious TV host's surprise lead narrowing sharply, prompting him to call on supporters to take to the streets of the capital to defend the vote.
President Juan Orlando Hernandez, who won US praise for helping tackle the flow of migrants and deporting drug cartel leaders, was favoured to win before Sunday's vote in the poor Central American nation with one of the world's highest murder rates.
But a delayed, partial count on Monday morning pointed toward an unexpected victory for TV entertainer Salvador Nasralla, 64. Inexplicably, election authorities then stopped giving results for more than 24 hours.
When – under mounting criticism from international election monitors over a lack of transparency – the electoral tribunal began updating its website again, the direction of the vote rapidly began to change.
In a television interview on Tuesday evening, an angry Nasralla said the election was being stolen from him and asked his supporters to flock to the capital, Tegucigalpa, to protest.
"We've already won the election," he said. "I'm not going to tolerate this, and as there are no reliable institutions in Honduras to defend us, tomorrow the Honduran people need to defend the vote on the streets."
The Electoral Observation Mission of the Organization of American States in Honduras urged people to remain calm and wait for official results, which it said should be delivered as quickly and transparently as possible.
Early on Wednesday morning, Nasralla's original five-point lead had thinned to under 1.5 percentage points, with about 73 percent of ballots counted, according to the election tribunal. The account then ground to a halt, presumably as election officials slept.
The election tribunal's delay was due to difficult negotiations between Hernandez's National Party and Nasralla's alliance, according to two European diplomats who spoke on condition of anonymity.
Behind closed doors, the parties were discussing immunity from prosecution for current officials and how to carve up positions in government, the diplomats said.
Hernandez's National Party appears set to retain control of Congress in the election, giving it the second-most important perch in the country.
The electoral body had been so certain Hernandez would win that it showed unprecedented transparency during the contest, one of the diplomats said. That left the body with little room to manoeuvre when Nasralla came from nowhere to take a strong lead.
Nasralla is backed by former President Manuel Zelaya, who was ousted in 2009 after he proposed a referendum on his re-election. The possible return to a position of influence for one-time leftist Zelaya risks fuelling concern in Washington.
The United States has longstanding military ties to Honduras and few ideological allies among the current crop of Central American presidents.
Hernandez, 49, was credited with lowering the murder rate and boosting the economy, but he was also hurt by accusations of ties to illicit, drug-related financing that he denies.
His bid for a second term, which was made possible by a 2015 Supreme Court decision on term limits, divided opinion in the coffee-exporting nation of 9 million people.