Zayd bin Salam reported,

Abu Sallam reported that Harith al-Ashari narrated to him that the Prophet ﷺ said:"Allah commanded Yahya bin Zakariyya with five words, that he should act upon them and command the Children of Israil to act upon them. But he was about to delay in conveying them, so Isa said to him, 'Allah has commanded you with five words to act upon and to command the Children of Israil to act upon. Either you command them, or I will command them.'Yahya replied, 'I fear that if you precede me in this, I may be swallowed up by the earth or punished.'So he gathered the people in Bayt al-Maqdis until the mosque was filled and people sat upon the elevated places. He said, 'Allah has commanded me with five words to act upon them and to command you to act upon them.The first is that you worship Allah and associate nothing with Him. The likeness of one who associates partners with Allah is like a man who buys a slave from his own pure wealth, with gold or silver, and says to him, 'This is my house and this is my work, so work and bring your earnings to me.' But the slave works and brings his earnings to someone other than his master. Which of you would be pleased for his slave to be like that?Allah commands you to pray, so when you pray, do not turn aside, for Allah sets His face directly toward the face of His servant during his prayer as long as he does not turn aside.I command you to fast. The likeness of fasting is like a man in a group who has with him a pouch containing musk, and all of them marvel at it, or find its fragrance pleasing. Indeed, the breath of the fasting person is more pleasing to Allah than the scent of musk.I command you to give charity. The likeness of this is like a man captured by the enemy, who tied his hand to his neck and brought him forward to strike off his head. He said, 'I will ransom myself from you with a little or much,' and so he ransomed himself from them.I command you to remember Allah. The likeness of this is like a man whom the enemy pursues swiftly, until he reaches a fortified fortress and protects himself from them. Likewise, the servant cannot protect himself from Satan except through the remembrance of Allah.'"The Prophet ﷺ said, "And I command you with five things that Allah has commanded me with: listening and obeying, jihad, hijrah, and the community. For whoever separates from the community by even a hand's span has cast off the yoke of Islam from his neck unless he returns. And whoever calls with the call of the days of ignorance is among the kneeling occupants of Hellfire."A man asked, "Messenger of Allah, even if he prays and fasts?"He replied, "Even if he prays and fasts. So call with the call of Allah, who has named you Muslims, believers, servants of Allah."

Azami 8473

Sahih

عن زيد بن سلام

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

الأعظمي 8473صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Stories of the prophets
Chapter
Reports of Sulayman عليه السلام
Section
Words that Allah commanded Yahya bin Zakariyya, peace be upon them both
Numbering
Jami al-Kamil 8473 (2nd edition)
Azami 8473