The authoritarian president for 22 years will be replaced by property developer Adama Barrow, who won more than 45% of the vote.
Yahya Jammeh, who came to power in a coup in 1994, has conceded, said electoral commission chief Alieu Momar Njie.
Before announcing the final result, Alieu Momar Njie appealed for calm as Gambia entered unchartered waters.
The African country has not had a smooth transfer of power since independence in 1965.
Mr Barrow won 263,515 votes (45.5%) in Thursday’s election, while President Jammeh took 212,099 (36.7%), according to the electoral commission.
Adama Barrow, who runs his own property company, reportedly used to work as a security guard at an Argos department store on London’s Holloway Road.
On the electoral campaign, he promised to revive Gambia’s economy, which has forced thousands of Gambians to make the perilous journey to Europe.
A devout Muslim, Yahya Jammeh, 51, once said he would rule for “one billion years” if “Allah willed it”.
Human rights groups have accused Yahya Jammeh, who has in the past claimed he can cure AIDS and infertility, of repression and abuses.
Several previous opposition leaders are in jail after taking part in a rare protest in April.
Observers from the EU and the West African regional bloc Ecowas did not attend the vote.
Gambian officials opposed the presence of Western observers, but the EU said it was staying away out of concern about the fairness of the voting process.
However, the African Union did dispatch a handful of observers to supervise the vote.
The Gambia, a tiny country with a population of fewer than two million, is surrounded on three sides by Senegal and has a short Atlantic coastline popular with European tourists.
Misleading allegations, rumours and outright lies about voting and fraud are flooding online spaces in…
At least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…
Elon Musk has said he will give away $1 million a day to a registered…