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.
The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…