Gambia's President Yahya Jammeh smiles during a rally in Banjul, Gambia, Nov. 29, 2016. Reuters

Gambia's President Yahya Jammeh agreed to step down Friday, heeding international calls to recognize an election loss last month and facing military pressure from neighboring states, according to incoming President Adama Barrow.

Jammeh initially accepted the results of the Dec. 1 national elections, which revealed a victory for opposition leader Barrow. A few days later, Jammeh declared a 90-day state of emergency, rejecting the legitimacy of the election. He had election officials arrested and called for a new set of elections to be held. ECOWAS had given Jammeh until Friday to step down.

Gambia's army chief announced Friday he would no longer stand by President Yahya Jammeh, who remained in power after losing a disputed election last month. General Ousman Badjie previously defended Jammeh, saying earlier this month he would defend Jammeh's government against a potential military intervention to oust the disputed leader. Badjie then reversed his position, further opening the door for neighboring militaries to send their troops into the capital to pressure Jammeh into stepping down from his 22-year rule or remove him by force.

Countries within the regional Economic Community of West African States (ECOWAS) back opposition leader Adama Barrow, who was sworn into office Thursday, and have sent soldiers to the border. Badjie said Thursday he would not take military action against an invasion by the international group's peacekeeping force, which mustered 7,000 troops backed by planes and tanks for what it has deemed Operation Restore Democracy. ECOWAS designated Senegal to head the operation because of its proximity to Gambia. Jammeh, however, reportedly relented.

Jammeh came to power in 1994 after staging a military coup against then President Dawda Jawara, which the new leader accused of corruption.

Jammeh's public persona has been defined by his strict piousness and eccentric beliefs. A devout Muslim, he often carries his signature prayer beads and wears traditional clothing. He has made headlines for his controversial claims that homosexuality threatened the existence of mankind and that he had devised a "foolproof" and "God-given" concoction for curing AIDS. The leader refused to explain the medical efficacy of the method, which involved green paste, a bitter drink and bananas.

Jammeh, who once vowed to rule his nation "for a billion years," won four multi-party elections and withdrew Gambia from the British Commonwealth of Nations in 2013. One year prior, he antagonized neighboring countries by executing all prisoners on death row, including foreign nationals from Senegal. Relations with the African Union and European Union have also been strained.