Opposition candidate Carlos Vila Nova has won the presidency in Sao Tome and Principe, an archipelago in the Gulf of Guinea, according to provisional official results.
The Portuguese-speaking nation elected Vila Nova of the centre-right opposition, who will now have to work with a left-of-centre government.
The president has largely ceremonial powers, authorised to arbitrate in political disputes but not to govern, although the tiny island chain has a long tradition of strong democracy.
Power lies with the prime minister, currently Jorge Lopes Bom Jesus of the Movement for the Liberation of Sao Tome and Principe (MLSTP), which won elections in 2018.
Vila Nova of the Independent Democratic Action (ADI) party garnered 57.54 percent of the vote against 42.46 percent for Guilherme Posser da Costa of the MLSTP, which leads the ruling coalition in parliament.
The electoral commission, in a statement carried by the state news agency STP-Press, declared Vila Nova the winner. A constitutional tribunal has a week to validate the results and hear any challenges.
Turnout was around 65 percent.
Who is Vila Nova?
Vila Nova, 65, is a telecommunications engineer who is little known among the general public.
He was a civil servant until 1988 when he went into the tourism business before going into politics, serving as public works minister from 2010 to 2012, then infrastructure and environment minister from 2014 to 2018.
He was elected to parliament in 2018.
The second-round runoff, initially set for August 8, was twice postponed.
The timetable was delayed after the third-placed candidate in the first round, Delfim das Neves, filed a petition against the result, alleging fraud. His suit was eventually rejected by the Constitutional Tribunal.
A total of 19 candidates stood in the first round on July 18.
Sao Tome exports cocoa and coffee and also lives on subsistence farming, fishing and tourism, but it remains overwhelmingly dependent on international aid.
About one-third of the population lives on less than the international poverty line of $1.90 a day, and more than two-thirds are classified as poor, according to the World Bank.