After more than two decades in power, Gambian President Yahya Jammeh faced the prospect of a midnight military intervention by regional forces, as the man who once pledged to rule the West African nation for a billion years clung to power late Wednesday.

A military commander with the regional bloc known as ECOWAS announced that Mr. Jammeh had only hours to leave or face troops already positioning along Gambia's borders.

"We are waiting so that all political means have been exhausted. The mandate of the president is finished at midnight," declared Seydou Maiga Moro, speaking on Senegalese radio station RFM.

"All the troops are already in place," he added, saying they were merely waiting to see whether Jammeh would acquiesce to international pressure to cede power to President-elect Adama Barrow.

As midnight approached, Jammeh was meeting with Mauritanian President Mohamed Ould Abdel Aziz on the crisis. The two leaders have had good relations.

Thousands of Gambians have fled the country, including some former cabinet ministers who resigned in recent days. Hundreds of foreign tourists were evacuating on special charter flights, though some continued to relax poolside despite the political turmoil. Gambia is a popular beach destination in winter, especially for tourists from Britain, the former colonial power.

The downtown area of the Gambian capital, Banjul, was empty late Wednesday, with all shops closed. But there was no visible military presence apart from a checkpoint at the entrance to the city, despite the threat of incoming forces.

Tiny Gambia is surrounded by Senegal and the Atlantic Ocean. Late Wednesday, witnesses reported Senegalese soldiers deploying in the Senegalese Kaolack region, north of Gambia, and in the southern Senegalese region of Casamance.

In another sign of the international pressure, Nigeria confirmed a warship was heading toward Gambia for "training," and RFM radio reported that Nigerian military equipment had begun arriving in Dakar in advance of the midnight deadline. Ghana also has pledged to contribute militarily.

The regional bloc was seeking the U.N. Security Council's endorsement of its "all necessary measures" to remove Jammeh. "There is a sense that the whole situation rests in the hands of one person, and it's up to that person, the outgoing president of the Gambia, to draw the right conclusions," said Sweden's U.N. Ambassador Olof Skoog, the current council president.

Jammeh, who first seized power in a 1994 coup, has insisted that his rule was ordained by Allah. He initially conceded defeat after the December vote, but after reports emerged suggesting he could face criminal charges linked to his rule, he reversed himself a week later. He said voting irregularities invalidated the results, and his party went to court seeking a new round of voting. The case has stalled because the supreme court currently only has one sitting judge.

Human rights groups have long accused Jammeh of arresting, jailing and killing political opponents, and there have been widespread fears for Mr. Barrow's safety amid the post-election turmoil. Tensions have been so high that Barrow has remained in the Senegalese capital since last weekend, at the advice of ECOWAS mediators, who feared for his safety. He was not even able to return to Banjul for his 7-year-old son's funeral Monday after the child was fatally mauled by a dog.

The opposition vowed Wednesday to go ahead with Barrow's inauguration, though there were no signs of preparation at the Banjul stadium where it was supposed to be held. It was unclear whether Barrow would take the oath at a Gambian Embassy outside the country or if he would return.

"Those who resist peaceful change, effective 12 midnight tonight, shall face definite consequences, to their peril," said Mai Ahmad Fatty, Barrow's special adviser, in a Facebook post in which he urged Gambians to stay indoors. "Anyone with firearms tonight shall be deemed a rebel, and will certainly become a legitimate target."

As other longtime West African strongmen have died or been forced to step down in recent years, Jammeh has remained a rare exception — even launching a campaign to anoint himself "King of Gambia."

In 2007, he claimed to have developed a cure for AIDS that involved an herbal body rub and bananas. Alarming public health experts, he insisted AIDS sufferers stop taking antiretroviral medications.

Two years later, his government rounded up nearly 1,000 people it accused of being witches, forcing them to drink a hallucinogen that caused diarrhea and vomiting. Two people died, according to Amnesty International.

More recently, Jammeh seemed bent on increasing Gambia's isolation on the world stage. In 2013 he exited the Commonwealth, a group made up mostly of former British colonies, branding it a "neo-colonial institution."

He also issued increasingly virulent statements against sexual minorities, vowing to slit the throats of gay men and saying the LGBT acronym should stand for "leprosy, gonorrhea, bacteria and tuberculosis." And in October, Jammeh said Gambia would leave the International Criminal Court, which he dismissed as the "International Caucasian Court."

___

This version corrects the surname of the military commander to Moro.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

___

Associated Press writers Abdoulie John in Dakar, Senegal; Robbie Corey-Boulet in Abidjan, Ivory Coast; Edith M. Lederer at the United Nations, Mike Corder in The Hague, Netherlands, and Bashir Adigun in Abuja, Nigeria, contributed to this report.