Hasan al-Basri (may Allah have mercy on him) said: Sayyiduna Ali (may Allah be pleased with him) sent someone to Sayyiduna Muhammad bin Maslamah (may Allah be pleased with him), and he was brought. He asked: What has held you back from this matter? He replied: Your cousin, that is, the Messenger of Allah (peace and blessings be upon him), gave me a sword and said: "Fight with it as long as there is fighting against the enemy; but when you see the people killing one another, take it to a rock and strike it against it, then keep to your house until a decreed death comes to you or a sinning hand reaches you." Then Sayyiduna Ali (may Allah be pleased with him) said: Leave him alone.
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 16572