Mali, Niger and Burkina Faso, three West African Sahel nations ruled by military juntas, have signed a security pact promising to come to the aid of each other in case of any rebellion or external aggression.
Delegations from the three countries announced the signing in Mali's capital Bamako on Saturday.
"This alliance will be a combination of military and economic efforts between the three countries", Mali's Defence Minister Abdoulaye Diop told journalists.
"Our priority is the fight against terrorism in the three countries."
The three countries are struggling to contain militant insurgents linked to Al Qaeda and Daesh and have also seen their relations with neighbours 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 defence and mutual assistance framework," Mali junta leader Assimi Goita said on his X, formerly known as Twitter.
Rift with France
All three states were members of the France-supported G5 Sahel alliance joint force with Chad and Mauritania, launched in 2017 to tackle militant groups in the region.
Mali has since left the dormant organisation after a military coup, while ousted Niger's President Mohamed Bazoum said in May last year that the force is now "dead" following Mali's departure.
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 it to withdraw its troops and its ambassador.
France has refused to recognise the authority of the junta.