Armed rebels who humiliated Mali's army in a deadly offensive across the northern desert agreed to a ceasefire on Friday after talks with African Union chairman Mohamed Ould Abdel Aziz, a diplomatic source said.