Honduras looks set to elect its first female president, Xiomara Castro, after the ruling party conceded defeat.
Ms Castro, the candidate for the left-wing Libre (Free) Party, has a preliminary lead of almost 20 percentage points over her rival.
Her victory will bring an end to the 12-year reign of the right-wing National Party, which has been plagued by scandals and corruption accusations.
Ms Castro will replace the divisive President Juan Orlando Hernández.
He has been dogged by allegations of ties to the drugs trade after his brother Antonio was jailed for trafficking in the United States.
Ms Castro has promised to "pull Honduras out of the abyss" of "a narco-dictatorship and corruption".
Her husband, Manuel Zelaya, ruled the country from 2006 until 2009, when he was ousted by a coup. She ran for office twice before in the years following his removal from power.
Votes are still being counted and the electoral council is yet to formally declare the winner. However Tuesday's concession of defeat by the governing party came two days after Ms Castro surged ahead in preliminary results.
Her main rival Nasry Asfura said on a local television broadcast that he had visited Ms Castro and her family.
"Now I want to say publicly that I congratulate her on her triumph and as president-elect," Mr Asfura said, adding: "I wish that God will enlighten and guide her so that her administration will do the best for all of us Hondurans".
The former first lady has promised big changes after taking office.
She inherits a country wracked by problems like violent crime, drug trafficking and large-scale migration to the US.
US Secretary of State Anthony Blinken has sent his congratulations, and said Washington is looking forward to working with her.
In the days leading up to the vote, it was abundantly clear that the National Party would struggle to hold onto power.
Such was the collective exhaustion at the past 12 years of National Party rule, a period characterised by widespread corruption and deep poverty, that people rarely admitted to planning to vote for them or their candidate, Nasry Asfura.
Rather, all the talk I heard was of change.
Whether among stall holders in a market in Tegucigalpa or in the queues outside the polling stations, everyone spoke in no uncertain terms of removing the incumbent government from office and of seeing the outgoing president, Juan Orlando Hernández, answer questions in a US court of his alleged drug-trafficking links.
He may have claimed repeatedly that he is not guilty of any wrongdoing but in the court of Honduran public opinion, he is considered a criminal and a spent political force. It was always going to be difficult to undo that perception at the polls.
Most Hondurans then, are celebrating the upcoming change in power.
The decision of the National Party to recognise their defeat - and avoid the violent scenes of four years ago - will also have been widely welcomed. Even if it did take them more than two days to do so.