Hadithcore
Riyad as-Salihin, 73

Abu Umamah (May Allah be pleased with him) said:

I heard Messenger of Allah (ﷺ) during the sermon of the Farewell Pilgrimage saying, "Be mindful of your duty to Allah; perform your five daily Salat, observe Saum during the month (of Ramadan) , pay the Zakat on your properties and obey your leaders; (if you do so) you will enter the Jannah of your Rubb". <b>[At-Tirmidhi, who categorized it as Hadith Hasan Sahih]</b>.

الخامس‏:‏ عن أبي أمامة صدي بن عجلان الباهلي رضي الله عنه قال‏:‏ سمعت رسول الله صلى الله عليه وسلم يخطب في حجة الوداع فقال ‏:‏ اتقوا الله ، وصلوا خمسكم، وصوموا شهركم، وأدوا زكاة أموالكم، وأطيعوا أمراءكم، تدخلوا جنة ربكم‏"‏ ‏(‏‏(‏رواه الترمذي، في آخر كتاب الصلاة وقال ‏:‏ حديث حسن صحيح‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Introduction, Hadith 73
Sharh · explanationclick to expand
<b>Guidance from the Hadith:</b><br> 1) It instructs commitment to the pillars of Islam because they, along with piety, lead to Paradise.<br> 2) The obligation of obeying the Muslim rulers because it is a form of piety unless they enjoin a sin, at which case obeying [this command] is prohibited; for indeed obedience is required in what is good only.