Senegalese President Macky Sall, on his first official visit to Nouakchott, said he and his Mauritanian counterpart Mohamed Ould Abdel Aziz shared the same view of the volatile situation in Mali after Islamists took control of the north amid the turmoil that followed a March coup in Bamako.
"We think that if the Malian factions want to engage in dialogue, we encourage them," Sall said. "But for those who choose the path of terrorism and the partition of Mali, they will face the consequences of their choice."
He did not elaborate on the comment.
The situation in northern Mali poses a serious threat to Sahel region security with "the growth of cross-border crime including trafficking in illegal arms, drugs and human beings, money-laundering and terrorism," the leaders said in a joint statement, urging a return to constitutional order.
On the same day in Ivory Coast, a special meeting of the Economic Community of West African States (Ecowas) was held in Abidjan to look into deploying an African intervention force to Mali.
The talks were organised after a formal request this month by Mali's interim President Dioncounda Traore for Ecowas military assistance to recover the occupied territory in the north and combat Islamist extremists there.
In July Senegal said it would not participate in an African force in Mali.
Mauritania, which is not an Ecowas member, has also said it would not intervene militarily, although it has sent its army into Malian territory in recent years to raid bases of al-Qaeda's north African branch Aqim.
The UN Security Council has so far failed to authorise Ecowas operations in Mali while military preparations have made little headway.
An international Sahel conference presided over by UN Secretary General Ban Ki-moon is to meet on the crisis in New York on September 26.