Mali, Niger and Burkina Faso, three West African Sahel nations ruled by military juntas, signed a security pact on Saturday promising to come to each other's aid in case of rebellion or external aggression.
The three countries are struggling to contain Islamist insurgents linked to al-Qaida and the Islamic State group and have also seen their relations with neighbors and international partners strained because of the coups.
The latest coup in Niger drove a further wedge between the three and countries of the regional bloc, the Economic Community of West African States, which has threatened to use force to restore constitutional rule in the country.
Mali and Burkina Faso have vowed to come to Niger's aid if it is attacked.
"Any attack on the sovereignty and territorial integrity of one or more contracted parties will be considered an aggression against the other parties," according to the charter of the pact, known as the Alliance of Sahel States.
It said the other states will assist individually or collectively, including with the use of armed force.
"I have today signed with the Heads of State of Burkina Faso and Niger the Liptako-Gourma charter establishing the Alliance of Sahel States, with the aim of establishing a collective defense and mutual assistance framework," Mali junta leader Assimi Goita said on X, the social media platform formerly known as Twitter.
All three states were members of the France-supported G5 Sahel alliance joint force with Chad and Mauritania, launched in 2017 to tackle Islamist groups in the region.
Mali has since left the dormant organization after a military coup, prompting Niger's now-ousted President Mohamed Bazoum to say in May of last year that the force was now dead.
Relations between France and the three states have soured since the coups.
France has been forced to withdraw its troops from Mali and Burkina Faso and is in a tense standoff with the junta that seized power in Niger after it asked France to withdraw its troops and its ambassador.
France has refused to recognize the authority of the junta.