A political crisis in The Gambia appears to be coming to a head, with Senegalese and Nigerian troops in the country to ensure long-time leader Yahya Jammeh gives up power after losing elections last month.
What happens next?
Mr Jammeh has asked for a deadline for him to leave office to be extended from noon until 16:00 GMT on Friday or be forced out by West African forces.
They deployed on Thursday after the internationally-recognised new president, Adama Barrow, was sworn in at his country's embassy in the Senegalese capital, Dakar, in front of ambassadors from countries in the UN Security Council and key African states.
Shortly afterwards the UN Security Council unanimously backed action against Mr Jammeh.
Troops have been told to halt their advance for a last attempt at negotiation by the presidents of Guinea and Mauritania, who have arrived in the Gambian capital, Banjul.
The chairman of West African regional bloc Ecowas, Marcel Alain de Souza, has said that if the meeting proved unsuccessful, military action will follow.
Mr Barrow, who remains in Senegal, has said that he will not return to Banjul until the operation has ended.
Ecowas mandated Senegal, which almost surrounds The Gambia, to lead a military intervention to install Mr Barrow. Nigeria has also sent aircraft and troops to Senegal, and deployed a warship.
Mr Barrow has urged soldiers in The Gambia to remain in their barracks and warned those that do not will be considered rebels.
The country is a popular tourist destination and after the British Foreign Office updated its travel advice, holiday companies have been evacuating tourists.
Is military intervention legal?
The UN Security Council unanimously backed Ecowas efforts to install Mr Barrow. However, the text of the resolution said this should be "by political means first" and made no explicit mention of military action. Some diplomats have suggested that formal UN authorisation for an intervention may not be necessary if Mr Barrow, having assumed the presidency, requested help.
What is Mr Jammeh's position?
Mr Jammeh tried to bolster his position earlier this week by declaring a state of emergency and engineering a parliamentary vote to extend his presidency by three months. He said these moves would prevent a power vacuum while the Supreme Court considered a legal challenge he has submitted over the election result.
The parliamentary vote took place while Mr Jammeh was officially president and is considered legally valid under Gambian law. This means The Gambia could now be considered to have two presidents, although each side obviously disputes the legitimacy of the other.
Regional powers chose to disregard the parliamentary vote on the grounds that Mr Barrow won December's election fairly and should take office. Without the extension, Mr Jammeh's term ended at midnight on Wednesday.
Will military intervention succeed?
The Senegalese-led intervention force will be expected to have more firepower than the Gambian army but it is not clear how much resistance it will face.
The army chief is a close Jammeh loyalist but has been quoted as saying he would not risk his men's lives in a political dispute.
The elite regiment of the army, drawn mainly from the same ethnic group as Mr Jammeh, is well-armed and is regarded as being fiercely loyal.
Mr Jammeh remains ensconced at State House with their protection and unnamed officials have been reported as saying these troops would resist any attempt to arrest him. However, they would be at a considerable numerical disadvantage to the intervening force.
The loyalty of other Gambian regiments is much less certain. Correspondents say there has been talk that some are unhappy with recent events and want a peaceful resolution.
How are the Gambian people reacting?
Tension is high in the Gambian capital over concerns that the political conflict will escalate into violence. Thousands of people have fled to neighbouring countries and rural areas.
Earlier this week, Mr Barrow's coalition urged Gambians to "exercise restraint, observe the rule of law and not to respond to provocation".
The BBC's Umaru Fofana, who is in Banjul, says people there are petrified. They are stocking up on food and water. Everyone has been praying for a peaceful resolution, he says.
What is the dispute over the election?
He filed a petition to the Supreme Court, challenging the election results, and says the existence of this legal process means it would be unconstitutional for Mr Barrow to assume office.
He also asked the Supreme Court for an injunction to stop the inauguration but the chief justice declined to rule on it, saying he must recuse himself from any case that could affect his own position - he would normally conduct the swearing-in ceremony.
Mr Jammeh has said there were irregularities in the election process, including the turning away of some of his supporters from polling stations, and errors made by the electoral commission.
The commission accepted that some of the results it initially published contained errors, but said Mr Barrow still won.
Retaining power would ensure he was not prosecuted in The Gambia for alleged abuses committed during his rule.
How have his allies reacted to the crisis?
Ministers are continuing to desert Mr Jammeh's government. Several ministers, and even the long-serving vice-president, have resigned in recent days.
One of the ministers who resigned, former information chief Sheriff Bojang, said Mr Jammeh's arguments had a "veneer of constitutionalism" but were an attempt to subvert the will of the Gambian people. The international community says Mr Barrow won fairly.
The lawyer representing Mr Jammeh and his APRC party in the election challenge has also fled to Senegal and urged the long-time leader to step aside.
What is happening at the Supreme Court?
Judges from Nigeria and Sierra Leone have been hired to hear the petition to overturn the election result, but they have yet to arrive in Banjul.
Gambian chief justice Emmanuel Fagbenle has said the court will be able to convene no earlier than May, and possibly not until November, because the Nigerian who is to act as court president, Onogeme Uduma, is fully booked for the coming months.
How might this be resolved?
Mr Barrow has distanced himself from comments, made by other opposition figures, suggesting Mr Jammeh may be prosecuted over alleged abuses in power.
He said Mr Jammeh should be able to stay in The Gambia and would be honoured as, and receive the privileges of, a former head of state if he stepped down.
However, Mr Jammeh does not appear to have been persuaded by his opponent's apparently conciliatory language.
Another option, raised by Nigerian MPs, is that Mr Jammeh could be offered asylum and a comfortable retirement in another African country.
Besides Nigeria, Morocco has been mooted as a possible destination (Mr Jammeh's wife is Moroccan).
With the entry of Senegalese and Nigerian troops, a third possibility now appears to be unfolding - that Mr Jammeh, having rejected all offers so far, continues to cling to power with the backing of at least some of the army, until he is forcefully removed.