BANJUL (Reuters) - Gambian President Yahya Jammeh vowed to stay in power when his mandate ends in January, defying calls from West African leaders to hand over to the winner of a Dec. 1 election.

Gambian President Yahya Jammeh holds a copy of the Quran while speaking to a poll worker at a polling station during the presidential election in Banjul, Gambia, December 1, 2016. REUTERS/Thierry Gouegnon

Regional bloc ECOWAS hopes diplomacy can persuade Jammeh to step down but has also warned him it would take “all necessary actions” to resolve the impasse. Neighboring Senegal has indicated that military action would be a last resort.

“I am not a coward. My right cannot be intimidated and violated. This is my position. Nobody can deprive me of that victory except the Almighty Allah,” Jammeh, who took power in a 1994 coup, said on state television late on Tuesday.

“The ECOWAS meeting was a formality. Before they came, they had already said Jammeh must step down. I will not step down,” he said, referring to a mediating visit by West African leaders to Banjul last week.

Jammeh’s rebuff places president-elect Adama Barrow in a vulnerable position. He is due to formally end his rival’s 22-year rule when he is inaugurated on Jan. 19 in a ceremony that West African leaders say they will attend.

ECOWAS has pledged to provide security for Barrow but bodyguards have not yet arrived.

His unexpected victory and Jammeh’s initial announcement that he would step down was greeted with joy on a continent where it is extremely rare for a veteran leader to lose an election and step down willingly.

It quickly became a test of regional mettle, though, when Jammeh reversed course, asserting that he was cheated and would challenge the result in Gambia’s supreme court.

The court has not heard cases for years but the chief justice said on Wednesday a hearing would take place on Jan. 10. with judges from Nigeria and Sierra Leone.

In a show of support for Jammeh’s legal challenge, the president of the African Bar Association, Hannibal Uwaifo, met him late on Tuesday and in a broadcast statement called for his case to be heard.

ECOWAS has mandated Nigerian President Muhammadu Buhari to mediate. ECOWAS deployed troops to Liberia and Sierra Leone during civil wars in the 1990s, setting a precedent for possible regional intervention. It also sent forces to Mali in 2013.

But African organizations, including the African Union, have a patchy record when it comes to putting pressure on leaders after disputed elections.

TIMETABLE FOR JAMMEH

Human rights groups say Jammeh’s government has arrested, tortured and killed perceived opponents.

A first step for raising pressure on Jammeh once the handover date passes might be targeted sanctions by ECOWAS, the United Nations, United States and European Union, diplomats said.

These could involve a travel ban. Diplomats say ECOWAS would probably seek approval from the U.N. Security Council, of which Senegal is a non-permanent member, for the use of force.

Senegal, which has a history of stormy relations with Gambia and sent troops there during a 1981 coup, is a likely candidate for leadership of any African intervention force given its position as Gambia’s only territorial neighbor.

In the interim, it may be possible to defuse the situation by offering Jammeh asylum, probably in Morocco or Saudi Arabia, diplomats said.

Barrow is already grappling with preparations for governing. One crucial task is securing the support of security forces who have seized the electoral commission since the vote.

Maggie Dwyer, a research fellow at the University of Edinburgh, said multiple coup attempts in the past suggest the army may be split and not completely reliable for Jammeh.