MALI's new interim leader threatened to wage war on Tuareg rebels and Islamists controlling the north of the country as he took the oath of office yesterday, ending a brief period of military rule.

Dioncounda Traore, the former speaker of parliament, was sworn into office in the capital at a ceremony attended by, among others, junta leader Capt Amadou Sanogo, who grabbed power in a coup on March 22.

Mr Traore, 70, took charge in a country facing its worst crisis yet, threatening to unleash "total war" on the Tuareg rebels, Islamists and outlaws who overran Mali's vast desert north in the power vacuum caused by the coup.

"I am aware of being the president of a country at war," said the mathematician turned politician, who is expected to name a prime minister and organise elections within 40 days. The rebels must "stop the . pillaging, the rapes, they must leave the cities that they have occupied", he said. "If they don't, we will not hesitate to wage a total and relentless war."

The junta had launched the coup that toppled former president Amadou Toumani Toure on the grounds that the government was not effective in resisting an uprising by Tuareg rebels that was rekindled in January.

But the rebels took advantage of the disarray in Bamako by capturing an area roughly the size of France, including the legendary town of Timbuktu, sparking warnings of humanitarian disaster in an area already gripped by acute food shortages and drought.

The 15-member Economic Community of West African States (Ecowas) immediately condemned the coup, hit the junta with sanctions and demanded it quit power, paving the way for yesterday's restoration of civilian rule. But the junta is expected to retain some influence, with observers saying coup loyalists could be named to key ministerial posts, notably those linked to security, as the army tries to reverse the rebels' huge gains.

Ecowas foreign and defence ministers were to meet in Côte d'Ivoire yesterday to consider the prospects of a military intervention in northern Mali as fears rise that the rebel-held region could become a haven for radical Islamists.

Ecowas has raised the prospect of sending a force of up to 3000 men to try to reclaim the region.

"We prefer peace, but if war is the only solution, we will make it with our army," said Mr Traore.

The Tuareg - many of them heavily-armed and battle-hardened from last year's Libya war where they fought as mercenaries for fallen dictator Muammar Gaddafi - took advantage of Mali's political chaos to step up their long-simmering separatist campaign. Joined by Islamist extremists linked to al-Qaeda in the Islamic Maghreb, they made unprecedented gains in the weeks since the coup, but that loose rebel faction has reportedly splintered.

The main Tuareg rebel group, Azawad National Liberation Movement (MNLA), has declared an independent Tuareg state, but their call has been rejected by the international community and by the MNLA's former Islamist allies.

Ansar Dine, the main Islamist group that controls several key towns, has imposed sharia and distanced itself from the Tuareg nationalist cause.