ADDIS ABABA, Ethiopia — African leaders agreed to send 7,500 troops to fight the Boko Haram insurgency in northeast Nigeria, an African Union official said Saturday, as the international community, including longtime foes the U.S. and Iran, rallied in support of Nigeria against the militants.

The move came after the council urged heads of state to endorse the deployment of troops from five West African countries to fight the terror group, said the head of the African Union’s Peace and Security Council, Samil Chergui.

African leaders who are members of the 54-nation African Union were meeting in the Ethiopian capital Addis Ababa for a two-day summit that ended Saturday.

U.N. Secretary-General Ban Ki-moon earlier said he supports the AU’s move to send a force to fight Boko Haram. Boko Haram is increasing its attacks as Nigeria prepares for Feb. 14 elections.

Iran also said Saturday it has begun consultations with West African countries affected by Boko Haram to provide help.

The country’s Deputy Foreign Minister Hossein Amir Abdollahian said he is confident the group could be defeated with collective action.

“We will share our experiences in combating terrorism to defeat Boko Haram. We will achieve that without a doubt,” the official said on the sidelines of the AU summit. The U.S. on Friday promised more technical support, training and equipment.

Boko Haram attracted international outrage in April when it kidnapped 276 schoolgirls at a boarding school in the remote town of Chibok. Dozens escaped on their own, but 219 remain missing.

Suicide bombings in recent months by young girls has raised fears that Boko Haram is using the kidnap victims in its conflict, which has displaced more than 1 million people and killed about 10,000 in the last year, according to the Council on Foreign Relations.