Bamako - Mali's President Dioncounda Traore on Friday called on the armed Islamist groups who control the north of the country to enter into talks with his government.
But while he said his first choice was dialogue, he also warned that the army would go to war if left with no other choice, in a televised speech given on the eve the country's Independence Day.
"As we are preparing for it, we will wage war if no other choice is left to us... ," said Traore, the country's interim president.
"But we reaffirm here that our first choice remains dialogue and negotiation," he said in the broadcast.
"I call on all armed groups operating in the north of our country to agree to commit resolutely to the path of dialogue and of negotiation in a sincere and constructive fashion," he added.
Traore deplored the fact that Tuareg militants in the north had made common cause with "cross-border and international terrorism" on the back of what he said was a flourishing drugs trade.
He described Mali's present situation as a "tragedy" and warned that the nation's very existence was at stake.
He was president, he said, of a country at war, and the army needed to be "re-equipped, morally rearmed, put on a war footing and most of all reconciled with itself."
The much-anticipated speech came as the UN Security Council on Friday called for West African nations to produce a "feasible and actionable" military plan to retake northern Mali from Islamist militants.
A statement from the 15-nation council expressed "grave concern" at the "increasing entrenchment of terrorist elements, including al-Qaeda in the Islamic Maghreb" in northern Mali.
Islamist groups and other rebels seized on the chaos of a military coup in Mali in March to take the north of the vast West African country. They have since imposed harsh Islamic law and desecrated Muslim shrines.
The Economic Community of West African States has called on the UN Security Council to back a proposed intervention force for Mali.
But the council has repeatedly said it needs more detail on the means and aims of any military operation and the consent of Mali's transitional government.
Mali was considered one of the region's stable democracies until a 22 March military coup plunged it into turmoil.
Tuareg nationalist groups and Islamists allied to al-Qaeda in the Islamic Maghreb (AQIM) took advantage of the ensuring confusion to step up their military campaign in the north.
They seized key towns in the huge arid north, an area larger than France or Texas. The Islamists have since forced out the Tuareg groups and imposed strict sharia law in the region.