Three Tuareg rebel groups occupying the key northern town of Kidal signed the agreement after talks with African Union chairman Mohamed Ould Abdelaziz.
Some 20 Malian soldiers have died since Wednesday in fighting over who holds the town.
The separatists have gained control of much of northern Mali in recent days.
In 2012 a Tuareg rebellion in northern Mali triggered a military coup in the capital, Bamako and an Islamist takeover of the north.
Civilian rule was re-established in 2013, but Islamist and separatist forces remain active in some areas.
Mohamed Ould Abdelaziz, the president of Mauritania, flew to Kidal on Friday to meet rebel groups including the National Movement for the Liberation of Azawad (MNLA).
Minister for Internal Security General Sada Samake signed the ceasefire on behalf of the Malian government at 21:30 GMT on Friday.
The ceasefire agreement includes a pledge to revive talks and the release of 300 Tuareg prisoners held in the capital.
Violence broke out in Kidal on Saturday when Malian PM Moussa Mara visited the town to show support for government forces based there.
The rebels seized government buildings, killed at least eight civilians and took around 30 hostages, who were later released.
The separatists said they defeated government forces the town on Wednesday.
MNLA fighters have also taken control of several other towns in the north, including Menaka, Agelhok, Anefis and Tessalit. They said earlier on Friday that they were close to the key city of Gao.
The government has accused the Tuaregs of being backed by al-Qaeda militants, and called for an immediate ceasefire.
dpznm_QQFKYImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…