The tiny nation of Gambia has West Africa on the brink of a military intervention, and thousands, including cabinet ministers, are fleeing the country. Longtime President Yahya Jammeh is refusing to step down after losing elections and has declared a state of emergency, and parliament has voted to extend his term by three months. On Thursday, President-elect Adama Barrow intends to go through with his inauguration, with the support of the international community. Here's a look at the crisis. "I CONCEDE ... NO, I DON'T" At first, Jammeh stunned Gambians by conceding his election loss on live television. A week later, he announced he had changed his mind, saying "only Allah" could deny him victory. After taking power more than 22 years ago in a bloodless coup, Jammeh has been accused of leading a government that detains, tortures and even kills opponents. He is no stranger to striking declarations: In late 2015, he abruptly announced Gambia to be an Islamic republic. In 2013, he decided to leave the Commonwealth. "A LEGAL CHALLENGE, BUT IS THERE A COURT?" Jammeh's ruling party is challenging the Dec. 1 election results, saying there were irregularities in the vote, but the country's Supreme Court says it could take months to act because it is short of judges. Jammeh has invited judges from Nigeria and Sierra Leone to complete the court, but that is not expected to happen until May. It is not clear what will happen if Barrow is inaugurated and the court later decides in Jammeh's favor. Barrow is in neighboring Senegal and has been urged by regional countries to stay there until Thursday's inauguration for his safety. His supporters insist he will be sworn in on Gambian soil. "REGIONAL TROOPS APPROACH BORDERS" The regional bloc known as the Economic Community of West African States has a standby military force ready to enter Gambia if Jammeh doesn't cede power. Troops were seen moving toward Gambia's borders on Wednesday, and a military commander announced that Jammeh has only hours to leave. The force was seeking the U.N. Security Council's endorsement of its "all necessary measures" to help remove Jammeh. Gambia, a nation of 1.9 million people, is estimated to have an army of just 900 troops. "A CONTINENT SHIFTS AWAY" If Jammeh doesn't step down, whether peacefully or not — he briefly sent troops to occupy the electoral commission office during the crisis — the African Union will cease to recognize him as Gambia's legitimate leader, the AU's Peace and Security Council said last week. In announcing the state of emergency Tuesday, Jammeh blamed what he called the unprecedented level of foreign involvement in Gambia's election.