Muhammad bin Maslama reported,

The Messenger of Allah said, "Muhammad, when you see people fighting one another over worldly gain, take your sword to the largest rock of the Harrah and strike it with the sword until it breaks. Then sit in your house until a wrongful hand reaches you or a decreed death overtakes you."So I did what the Prophet ﷺ commanded me.

Azami 15737

Sahih

عن محمد بن مسلمة قال

قال رسول الله: يا محمد، إذا رأيت الناس يقتتلون على الدنيا، فاعمل بسيفك إلى أعظم صخرة الحرة، فاضرب بها حتى ينكسر، ثم اجلس في بيتك حتى تأتيك يد خاطئة، أو منية قاضية، ففعلت ما أمرني به النبي ﷺ.

الأعظمي 15737صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tribulations and signs of the Hour
Chapter
Tribulations
Section
Prohibition of striving in fitnah
Numbering
Jami al-Kamil 15737 (2nd edition)
Azami 15737