Earlier results triggered deadly street violence and protests.
Hernández's main opposition Salvador Nasralla accuses electoral authorities of vote-rigging.
The Organisation of American States (OAS) had urged authorities not to announce a final result and said "serious questions" persisted.
But the country's electoral tribunal announced in a televised address on Sunday that the incumbent President Hernández won by 1.53% of the vote, says a BBC report.
Authorities had initially said Nasralla had a five-point lead on the morning after the election on 25 November.
That gap began to close after a computer problem was reported at the vote-tallying centre in the capital, Tegucigalpa.
The OAS requested a partial recount from nearly 5,000 ballot boxes after a number of alleged irregularities in the vote.
European Union electoral observers said on Sunday the recount showed no irregularities.
President Hernández, 49, has been in power since 2013, and is the first president to run for a second term after the country's supreme court lifted a ban on re-election.
Nasralla is a former TV presenter and sports journalist, who lost the 2013 vote. He has campaigned to battle corruption and heads up a coalition of parties from the left and right in the Opposition Alliance Against the Dictatorship.
The result was announced as he left for the United States to meet officials at the State Department to highlight his complaints about the vote.
Following the announcement, he said it was clear there had been fraud "before, during and after" the contested vote.
Former President Manuel Zelaya, who backed Nasralla in the election, called for renewed protests after the result announcement.
Thousands of people have taken to the streets in rival demonstrations in the weeks since the election.
Human rights group Amnesty International says 14 people died in days of clashes, but police dispute the number and say only three have died.
The government imposed a curfew, which was lifted after a week, as violence was controlled.