The U.N. Security Council on Thursday voted unanimously to establish a U.S.- and European-backed African force to rebuild Mali’s troubled military and to begin preparing it for a possible military offensive to retake control of sections of the country from separatists and Islamic extremists.

The European Union plans to send military experts to Bamako in the coming months to begin training the Malian army to lead a campaign to conquer the north. But the wider African force — which is expected to be made up of several thousand troops from West Africa and the Sahel — is unlikely to be sent to Mali before September or October.

The resolution does not specify what role the United States would play in the military campaign against extremists. But it provides wide legal scope for foreign governments to “take all necessary measures” — including the use of lethal force — and to provide “any necessary assistance” in support of the Malian fight.

The Obama administration has harbored deep misgivings about the ability of a Malian-led force to prevail in combat with Islamic radicals in the region, including those aligned with al-Qaeda. But Thursday’s vote ended weeks of tense negotiations between France, which was determined to authorize a new force before the year’s end, and the United States, which wanted to wait until the country had elected a new civilian president.

The United States agreed to co-sponsor a resolution after securing a commitment from France to ensure that the United States and other Security Council members would be given another shot at reviewing the military plan before the force receives a green light for offensive operations.

Following the vote, France’s U.N. ambassador, Gerard Araud, said a military attack on Islamic forces in northern Mali was not inevitable and that his government had hope that the crisis could be resolved through political dialogue with more moderate insurgents. The resolution, he said, “is not a declaration of war.”

Long a model of African stability and democracy, Mali’s civilian government has faced a series of existential threats to its rule this year, including a rebellion in the north by an alliance of Tuareg and al Qaeda-linked groups, followed by a military coup carried out by soldiers embittered by the failure of ousted president Amadou Toumani Toure to adequately supply troops seeking to put down the rebellion.

In recent months, Islamic militants groups including al-Qaeda in the Islamic Maghreb and the Movement for Unity and Jihad in West Africa have seized control of the uprising, driving out their erstwhile Tuareg allies from key northern cities, including Timbuktu and Gao, imposing sharia law and committing widespread human rights abuses.

Their presence has raised concern in Washington, which is expected to help train, equip and provide transport for the new force, known as the African-led International Support Mission in Mali, or Afisma.

But the political turmoil in Mali has complicated the American role. U.S. law restricts U.S. financial assistance to Mali, because its democratic government was ousted in a coup in March.