The Gambia faces the prospect of military intervention by regional forces after a last-ditch attempt to convince Yahya Jammeh to step down as president failed.

Jammeh, who lost a December 1 presidential vote to Adama Barrow, has refused to leave office  despite international pressure and a threat by leaders of the Economic Community of West African States, or ECOWAS, to enforce his election defeat.

AL JAZEERA'S NICOLAS HAQUE, REPORTING FROM DAKAR IN NEIGHBOURING SENEGAL: 

Troops from Senegal, Ghana, Nigeria, Mali and Togo are at the borders of Senegal, waiting for a green light to intervene and unseat Yahya Jammeh, who according to the constitution is no longer the country's legitimate ruler.

Banjul has been turned into a 'ghost town' with tens of thousands of people fleeing the capital and at least 26,000 crossing the border into Senegal.

Meanwhile, Ousman Badjie, the chief of defence staff, has said that he will not put his men on the line and they will not fight or die for Yahya Jammeh. 

Barrow - who fled to Senegal earlier in the week - has pledged to go ahead with his inauguration on Thursday on Gambian soil.

Barrow on Thursday tweeted that he would be holding the inauguration ceremony at the Gambian embassy in Dakar, the Senegalese capital.

A deadline of Wednesday midnight for Jammeh to resign passed without the president of 22 years indicating that he would leave office.

Eyewitnesses said the situation was calm in the capital Banjul overnight despite forces loyal to Jammeh being deployed in the city and troops from Senegal, Nigeria and Ghana amassing along the Senegalese border.

Al Jazeera's Ahmed Idris, reporting from the Nigerian capital Abuja, said that deployment involved air, naval and ground troops.

"A ship of the Nigerian navy is off the coast of Ghana on the way to Gambia, and there are reports that Ghana may also be contributing to the troops' deployment to Gambia, in addition to Senegal," he said.

The UN Security Council is scheduled to meet on Thursday to adopt a statement on the Gambia that will reaffirm the demand for Jammeh to hand over power, diplomats said.

READ MORE: Exiled Gambians ponder return to troubled homeland

Despite at least eight ministers resigning in the past 48 hours, Ousman Badjie, the chief of defence staff, has repeatedly pledged loyalty to Jammeh.

Robin Sanders, a former US ambassador to ECOWAS, told Al Jazeera it was unclear how the Gambian military would react to foreign intervention.

Thousands fleeing to Senegal amid Gambia crisis

"The Gambian military is divided along ethnic lines and it's really unclear whether forces loyal to Jammeh will fight against ECOWAS considering how they lack the wherewithal and strength to do so," she said.

"A medium-term compromise can be brokered like what was recently done in the Democratic Republic of Congo . It may not be the best solution, but the most important thing is to keep the peace and ensure we don't have a mass exodus of refugees to neighbouring countries."

However, Benjamin Lawrance, a professor of International Studies at the Rochester Institute of Technology, said there was "potential for violence" with Jammeh loyalists prepared to stick with him to the very end.

"All military are susceptible to violence when the opportunity presents itself," Lawrance told Al Jazeera. "There could be isolated incidents such as shootings or cases of sexual violence.

"There is also a small cohort of loyalists, the Jungullers paramilitary group and the State Guard, Jammeh's private police. Both are very loyal and, should Jammeh find himself cornered by African troops, they could put up a strong fight."

Jammeh's refusal to step down has created political and humanitarian turmoil.

So far, at least 26,000 Gambians have fled to neighbouring Senegal after Jammeh declared a state of emergency on Tuesday.

The Gambia is one of Africa's smallest countries and has had only two rulers since independence in 1965.

It is completely surrounded by Senegal and the Atlantic.

Jammeh seized power in a coup in 1994 and his government has gained a reputation among ordinary Gambians and human rights activists for torturing and killing opponents.

Source: Al Jazeera and news agencies