(CNN) Gambia's longtime leader, Yahya Jammeh, has left the country after stepping down as president following tense negotiations amid the prospect of West African military intervention.

He has arrived in Conakry, Guinea, according to a Gambia Civil Aviation Authority official who did not want to be named.

In a televised address on Saturday morning, Jammeh said it was his duty to "preserve at every instant" the lives of Gambians.

"I have decided today in good conscience to relinquish the mantle of leadership of this great nation with infinite gratitude to all Gambians," he said.

The longtime leader was facing a showdown with troops from neighboring Senegal who entered the small West African country less than 24 hours earlier to enforce the results of last month's presidential election.

The UN Security Council had backed an effort by regional states to remove Jammeh as president.

There was a brief ceremony for Jammeh at the airport in Gambia's capital, Banjul. His loyalists cried while others jeered the outgoing leader.

Last-minute negotiations with the presidents of Guinea and Mauritania focused on encouraging Jammeh to cede power to new President Adama Barrow.

The Commission of the Economic Community of West African States, or ECOWAS, gave Jammeh until noon Friday to step aside or face being forcibly removed.

"If at noon he doesn't accept to leave Gambia, the troops will intervene militarily to remove him by force so we can install the new President with all his powers in accordance with the Gambian Constitution," Marcel A. de Souza, the commission's president, told Reuters.

"By land, sea and air, Gambia is surrounded. A total of 7,000 men will participate in the mission to re-establish democracy in Gambia."

New President sworn in

Jammeh, who took power in a 1994 military coup, suffered a surprise election defeat in December to Barrow, who won 45% of the vote. Jammeh originally conceded the presidency but then announced his "total rejection of the election results."

Barrow was sworn in Thursday in Senegal.

It's not known when Barrow will return to Gambia, but Cabinet members are expected to be announced Monday, according to a Gambia Coalition spokesperson. The National Assembly may act Sunday to lift the state of emergency, which was the vehicle Jammeh used to stay in power.

ECOWAS troops control the statehouse and have been deployed in different locations in Gambia to prepare the country for the Barrow's return.

Around 45,000 people have reportedly arrived in Senegal from Gambia amid the turmoil, the UN refugee agency said Friday, citing the Senegalese government.

A convoy of Senegalese soldiers head toward Gambia's border Thursday.

The United Nations called on "all stakeholders, within and outside the Gambia, to exercise restraint, respect the rule of law and ensure the peaceful transfer of power."

ECOWAS, the African Union, and the United Nations issued a joint statement Saturday ensuring Jammeh "is at liberty to return" to Gambia "at any time of his choosing."

Groups also called for the Gambian government to guarantee "the dignity, security, safety and rights" of Jammeh's family, Cabinet members and loyalists.

Talks to urge Jammeh to leave

Two West African leaders and a UN representative met on Friday with Jammeh to persuade him to step down peacefully, an official on the longtime ruler's team told CNN.

Mohamed Ibn Chambas, special representative of the UN secretary-general and head of the UN Office for West Africa and the Sahel, was a key figure in talks by regional leaders to persuade Jammeh to leave, the official said.

An African Union statement welcomed Barrow's swearing-in as the legitimate president and expressed "the readiness of the AU to work closely with the new Gambian authorities to promote peace, security, stability and reconciliation in their country."

The South African government also called upon Jammeh to step down peacefully.

Leader in waiting

Barrow has been waiting in Senegal -- which surrounds Gambia -- for the handover of power. In his first speech as leader, he hailed the "victory of the Gambian nation."

This is a victory of the Gambian nation. Our national flag will fly high among those of the most democratic nations of the world. #Gambia pic.twitter.com/QRGZg1gzbs — Adama Barrow (@adama_barrow) January 19, 2017

"Our national flag will now fly high," he said Thursday. "Violence is finished forever from the life of the Gambians. There is no loser in this election. We promise to unify our people. Today most Gambians are united in order to give Gambia a new start. Today, I am the President of all Gambians."

JUST WATCHED 'A situation of contested legitimacy' in Gambia Replay More Videos ... MUST WATCH 'A situation of contested legitimacy' in Gambia 05:02

He pledged to "respect the rule of law and fundamental freedoms" and promised "significant democratic reform."

And he called on the country's military to remain loyal: "I command all members of the armed forces to remain in their barracks. Those found wanting, or in possession of firearms, without my order, shall be considered rebels."

Maj. Gen. Ousman Badjie, defense chief of the Gambian armed forces, told CNN he now considered Barrow the commander in chief.

Facing uncertainty at home, people in Banjul, Gambia, head to a ferry this week bound for Senegal.

Badjie said the situation needed to be solved politically, not militarily.

Seeking safety

Save the Children warned of the danger of a humanitarian emergency as people fled their homes.

"These children are largely fleeing to parts of both Gambia and Senegal where public services such as health facilities and schools are already under a great deal of strain," said Bonzi Mathurin, Save the Children's Senegal director.

The Senegalese soldiers are tasked with removing Gambia's Yahya Jammeh if he doesn't step down.

Hundreds of tourists have been pouring out of Gambia as the risk of violence grows, and the United States and United Kingdom issued warnings to citizens to consider leaving the country.

In a statement on its website, tour operator Thomas Cook said it was "working hard to get our UK customers home" and it expected to fly about 3,500 vacationers out of Gambia by the end of Friday.

British tourist Sara Wilkins, 44, told CNN she and her husband arrived in Gambia nearly a week ago and noticed a lot of military on the streets. She said they had not been able to leave their hotel in recent days.

Tourists gather at the Banjul airport Wednesday as tour operators send in extra flights for evacuation.

Wilkins said she had witnessed "manic" scenes at the airport and at the hotel, where "everyone was panicking and crying."

The United Kingdom warned that "potential for military intervention and civil disturbance is high and could result in Banjul International Airport being closed on short notice."