Guinea-Bissau's former military ruler Joao Bernardo Vieira has won run-off presidential elections, the electoral commission has announced.
Mr Vieira first came to power in a coup in 1980
Mr Vieira, known as Nino, came to power in a coup and ruled for 18 years until overthrown in 1999 by the armed forces.
Hours before the provisional results were announced, a spokesman for Mr Vieira's rival said he would reject the results because of fraud allegations.
Rival supporters briefly clashed in the capital after the announcement.
The election is intended to end years of coups and political instability.
During his campaign, Mr Vieira described himself as a gift of God to the people of Guinea-Bissau coming back to once again lead them to development and prosperity.
Mr Viera took 55% of the vote compared to 44% gained by his challenger Malam Bacai Sanha, the electoral commission said.
1980: Seized power in a coup
1994: Won elections
1999: Ousted in a coup
2005: Wins run-off with 55.75%
Support base: Urban youth
Both candidates had previously promised to respect the outcome of the election but a spokesman for Mr Sanha, Desejado Lima Da Costa said there had been fraud in two places, including the capital, Bissau, which must be addressed first.
He also criticised the head of the electoral commission for refusing requests for a recount.
European monitors said voting was "calm and organised".
Mr Sanha gained the most votes in the first round of voting.
Before the results were announced, electoral commission spokeswoman Vera Cabral Monteiro said:
"The results will be published Thursday if we have all of the security guarantees in place."
"Without those guarantees, we cannot release the results, even though we have them. We cannot endanger people's lives."
There were some disturbances during campaigning, and one person was killed when police opened fire on former President Kumba Yala's supporters protesting against his failure to make the run-off.
An attack by gunmen on the country's presidential palace and interior ministry also raised tensions ahead of the poll.
Guinea-Bissau won independence from Portugal in 1974, but has had a chequered history of coups and military dictatorships ever since.
Mr Sanha's PAIGC party ruled the country from independence until it was overthrown by Mr Vieira in 1980.
Mr Vieira then won presidential polls in 1994, but was himself overthrown in 1999 as the country descended into civil war.