After leading by about 5 percentage points in initial results announced early Monday, opposition candidate Salvador Nasralla had 42.11 percent of the votes Wednesday night, barely behind 42.21 percent for Hernandez, according to the latest returns on the electoral court's website.
Public updates of the vote count essentially stopped for over a day after the initial report, then resumed in a trickle of returns. A slow but inexorable evaporation of Nasralla's lead raised tensions in the country and fed suspicions among his supporters that the count was being manipulated.
Late Wednesday, Nasralla disavowed a promise he made with the Organization of American States to respect the official outcome.
"I signed that document before the electoral court's computing center went down, and that was a trap," Nasralla said at a news conference. "The agreement with the OAS was to respect trustworthy results without alterations ... and the court has altered the documents in the last two days. That is unacceptable."
"We will not recognize the results of the cheating system of the electoral court," he added, declaring himself the rightful next president "by the decision of the people."
David Matamoros, president of the electoral court, acknowledged the computer outage but insisted there was no problem with the vote count from Sunday's election.
"There was a failure in the court's computing system, but not critical, and it is now functioning properly," he said in an interview with Channel 3.
Matamoros did not specify how long the outage lasted but said the final count would now be announced Thursday instead of Wednesday night as previously promised.
Hernandez, whose supporters already claimed victory on his behalf, called on all parties to be patient and await the official result "with calm and in peace." He also committed to respecting the result.
"We should wait and respect the final scrutiny as the law requires. I ask for celerity from the (electoral court) and prudence from the parties," he said on Twitter. "Honduras deserves it."
Nasralla offered no specific evidence of wrongdoing. Nonetheless he called on the 500 international election observers in Honduras to form a special commission to investigate, "or else Hernandez will steal the victory, and I won't tolerate it."
The challenger later said his political alliance would block roads in Honduras' main cities. Several roadblocks were quickly reported on several highways.
Earlier Wednesday, thousands of flag-waving opposition alliance supporters marched down two central boulevards in the capital Wednesday heading for the electoral court facilities where the vote count was under way.
Karo Avila, a college student studying journalism, was among them. "I am from the National Party and I'm ashamed by what is happening because I see how some lend themselves to the whims of those who don't want to let go of the government," Avila said.
Supporters of the governing National Party also held "victory caravans," waving blue- and white-starred flags from automobiles.
U.S. State Department spokeswoman Heather Nauert urged the candidates to respect the official results once they are available.
"We await the final tabulation of results by election authorities and urge the authorities to complete their work without undue delay," Nauert said. "The United States urges calm and patience as the results are tabulated."
Several U.S. lawmakers expressed concern and urged transparency.
An election observation mission from the Organization of American States has also called for calm.
Nasralla and supporters of the opposition alliance are sensitive to any whiff of election shenanigans. It was Hernandez's National Party that orchestrated the coup that removed President Manuel Zelaya from office in 2009.
Zelaya formed the Libre Party and his wife, Xiomara, lost to Hernandez in 2013 as its candidate. Libre formed an alliance for the 2017 election and chose Nasralla, a sportscaster and television personality, as its candidate.
Associated Press writers Christopher Sherman and Peter Orsi in Mexico City contributed to this report.
Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.