"I have decided today in good conscience to relinquish the mantle of leadership of this great nation," Jammeh said on state television, wearing a white robe and looking tired.
Yahya Jammeh, who led his country for 22 years but refused to accept his election defeat to new President Adama Barrow last month, has agreed to step down and go into exile. He said his decision was taken in the national interest after prayer and said he was proud to have served the Gambian people, imploring them to work together as one nation.
It has not been specified where Mr Jammeh would go into exile.
The news came as regional armies, who entered Gambian territory late on Thursday, were poised to remove Mr Jammeh by force just hours after the army chief recognised Mr Barrow as commander-in-chief.
The force, including tanks, rolled into The Gambia without facing any resistance, said Marcel Alain de Souza, chairman of the West African regional bloc, ECOWAS.
It included troops from Senegal, Ghana, Nigeria, Togo and Mali, and they moved in after Mr Barrow's inauguration and a unanimous vote by the UN Security Council to support the regional efforts.
|Nigerian Military Tanks|
Fearing violence, about 45,000 people have fled The Gambia for Senegal, according to the Senegalese government and the UN refugee agency.
West African leaders Alpha Conde of Guinea and Mauritania's President Mohamed Ould Abdel Aziz travelled to the Gambian capital Banjul on Friday to try mediating and give Mr Jammeh one last chance to cede power peacefully.
Mr Barrow, who won the December 1 poll by a slim margin, was sworn into office at The Gambia's embassy in the Senegalese capital of Dakar on Thursday and immediately called for regional and international support.
West African militaries announced soon after that they had crossed into The Gambia, which is almost completely surrounded by Senegal.
"The rule of fear has been banished from Gambia for good," Mr Barrow told a crowd gathered at a Dakar hotel on Friday.
"To all of you forced by political circumstances to flee our country, you now have the liberty to return home."
Earlier, The Gambia's army chief General Ousman Badjie — who had been perhaps the last remaining pillar of support for Mr Jammeh — said he would welcome, and not fight, the regional force.
"We are going to welcome them with flowers and make them a cup of tea," he said.
"This is a political problem. It's a misunderstanding. We are not going to fight Nigerian, Togolese or any military that comes."
Mr Jammeh, who first seized power in a 1994 coup, has offered to step aside once before only to change his mind later.
He has been holed up in his official residence in Banjul, and was becoming increasingly isolated as his security forces abandoned him and he dissolved his Cabinet.
Late on Friday, Mr Barrow addressed members of The Gambia's diaspora and urged them to return home and rebuild their lives.
"I wish to congratulate all of you and welcome you to the new Gambia."