NIAMEY, Niger (AP) — Niger is swearing in its new president Friday in the West African nation’s first democratic transfer of power.

Newly elected President Mohamed Bazoum’s inauguration Friday comes days after Niger’s security forces thwarted an attempted military coup at the presidential palace overnight from Tuesday into Wednesday. Niger already faces unprecedented threats from Islamic extremists near its troubled border with Mali.

Bazoum succeeds President Mahamadou Issoufou who is stepping down after serving two terms, in accordance with Niger’s constitution. Issoufou’s decision to respect the constitution has been widely hailed and paves the way for Niger’s first peaceful, democratic transfer of power since its independence from France in 1960. The West African nation has seen four coups.

Fears, however, have been mounting that the inauguration could prompt more violence in Niger. The latest massacre killing at least 137 people came on the same day the constitutional court certified Bazoum’s electoral victory. And at least 100 others were killed in villages near the border on the day that Niger announced the presidential election would go to a second round on Feb. 21.

Security was tight Friday in the capital, Niamey.

Bazoum is Issoufou’s chosen successor and a longtime Cabinet minister who is from Niger’s small ethnic Arab minority. He was a former interior minister in Niger and is also a teacher by training.

His main election rival, Mahamane Ousmane, has rejected election results claiming fraud. Supporters for Ousmane have held mass demonstrations.