Yahya Jammeh made the announcement on national TV, saying it was “not necessary that a single drop of blood be shed”.
The statement followed hours of talks between Yahya Jammeh and West African mediators. He gave no details of what deal might have been struck.
Yahya Jammeh has led The Gambia for 22 years but was defeated in December’s election by Adama Barrow.
Adama Barrow has been in neighboring Senegal for days and was inaugurated as president in the Gambian embassy there on January 19.
Troops from several West African nations, including Senegal, have been deployed in The Gambia, threatening to drive Yahya Jammeh out of office if he did not agree to go.
Yahya Jammeh’s decision to quit came after talks with the presidents of Guinea and Mauritania.
He said: “I have decided today in good conscience to relinquish the mantle of leadership of this great nation with infinite gratitude to all Gambians.
“I promise before Allah and the entire nation that all the issues we currently face will be resolved peacefully.”
Shortly before the TV address, Mauritanian President Mohamed Ould Abdel Aziz said that a deal had been struck and that Yahya Jammeh would leave the country. He gave no further details.
Yahya Jammeh was given an ultimatum to leave office or be forced out by UN-backed troops, which expired at 16.00 GMT on January 20.
The deadline was set by the Economic Community of West African States (ECOWAS), a regional grouping backed by the UN.
Yahya Jammeh had at first accepted defeat in the election but then reversed his position and said he would not step down.
He declared a 90-day state of emergency, blaming irregularities in the electoral process.
The electoral commission accepted that some of its early results had contained errors but said they would not have affected Adama Barrow’s win.
Yahya Jammeh had vowed to stay in office until new elections were held.
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…