Updated

Longtime Gambian leader Yahya Jammeh agreed Friday to yield power to the man who defeated him in last month's presidential election, a Senegalese government official said.

Jammeh had refused to accept the results of the election he lost to Adama Barrow, who was inaugurated Thursday at Gambia's embassy in neighboring Senegal. The leaders of Guinea and Mauritania met with Jammeh on Friday to try to persuade him to step down.

The Senegalese government official, who spoke on condition of anonymity because the official was not authorized to talk to reporters, said final arrangements to the agreement with Jammeh were still being worked out.

"The rule of fear has been vanished from the Gambia for good," Barrow told members of the diaspora in Senegal's capital late Friday.

Jammeh, who first seized power in a 1994 coup, has offered to step aside once before during the current crisis -- only to change his mind later.

He has been holed up in his official residence in the capital, Banjul, and was becoming increasingly isolated as his security forces abandoned him and he dissolved his Cabinet.

A West African regional military force was poised to move against Jammeh if he refused to step down.

Defense forces chief Ousmane Badjie told The Associated Press that Gambia's security services all support Barrow and would not oppose the regional force.

"You cannot push us to war for an issue we can solve politically," Badjie said. "We don't see any reason to fight."

The force, including tanks, rolled into Gambia without facing any resistance, said Marcel Alain de Souza, chairman of the West African regional bloc, ECOWAS. At least 20 military vehicles were seen Friday at the border town of Karang.

The force included troops from Senegal, Ghana, Nigeria, Togo and Mali, and they moved in after Barrow's inauguration and a unanimous vote by the U.N. Security Council to support the regional efforts.

Jammeh met Friday with Guinean President Alpha Conde and President Mohamed Ould Abdel Aziz of Mauritania, which has been mentioned as a possible home in exile for Jammeh. After a first round of talks, they broke for Friday prayers and resumed.

Jammeh "has the choice of going with President Alpha Conde," de Souza said, but if that fails, "we will bring him by force or by will."

Jammeh had agreed to step down but demanded amnesty for any crimes he may have committed during his 22 years in power and wanted to stay in Gambia, in his home village of Kanilai, de Souza said. Those demands were not acceptable to ECOWAS, he added.

In his inaugural speech, which took place under heavy security, Barrow urged Jammeh to respect the will of the people and step aside. He also called for Gambia's armed forces to stay in their barracks.

Some of Gambia's diplomatic missions began switching their allegiance.

"We embrace and support the new president Adama Barrow," said Almamy Kassama, an official at the Gambian mission to the African Union in Addis Ababa, Ethiopia, in an email.

Senegalese radio station RFM reported 30 Gambian soldiers had crossed into Senegal to fight alongside the regional forces.

"I think the Gambian military would know it's outnumbered," said Maggie Dwyer, an expert on West African armed forces at the University of Edinburgh. "Gambia's military has very little combat experience. This would be a very difficult situation for them."

She estimated it had 2,400 troops at most, plus fewer than 1,000 paramilitary forces.

"My guess is a very small number would actually put their life on the line for Jammeh," though some could stand by him to get the same deal he might receive to avoid prosecution, Dwyer said.

Soldiers at checkpoints in Banjul appeared relaxed, with one telling visitors, "Welcome to the smiling coast."

African nations including South Africa continued stepping away from Jammeh, with the African Union saying the continental body no longer recognizes him.

About 45,000 people have fled Gambia for Senegal, fearing violence, according to the Senegalese government and the U.N. refugee agency. About two-thirds are children accompanied by women, the U.N. said.

Only about a few thousand international tourists are believed to still be in Gambia, and efforts continued to evacuate them.