Jareer bin Abdullah reported,

On the day Mughira bin Shuba died, he stood up, praised Allah and glorified Him, and said, "You must fear Allah alone, who has no partner, and maintain dignity and calm until a new governor comes to you. He will arrive shortly."Then he said, "Seek pardon for your governor, for he loved to pardon others."Then he said, "To proceed, I came to the Prophet ﷺ and said, 'I pledge allegiance to you upon Islam.' He stipulated upon me sincere counsel to every Muslim, so I pledged allegiance to him on this. By the Lord of this mosque, I am sincere in my counsel to you."Then he sought forgiveness from Allah and stepped down.

Bukhari 58

Sahih

حدثنا أبو النعمان قال حدثنا أبو عوانة عن زياد بن علاقة قال سمعت

جرير بن عبد الله يقول

يوم مات المغيرة بن شعبة قام فحمد الله وأثنى عليه وقال عليكم باتقاء الله وحده لا شريك له والوقار والسكينة حتى يأتيكم أمير فإنما يأتيكم الآن ثم قال استعفوا لأميركم فإنه كان يحب العفو ثم قال أما بعد فإني أتيت النبي ﷺ قلت أبايعك على الإسلام فشرط علي والنصح لكل مسلم فبايعته على هذا ورب هذا المسجد إني لناصح لكم ثم استغفر ونزل

البخاري 58صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Faith
Chapter
Prophet's ﷺ saying, "Religion is sincere advice to Allah, to His Messenger, to the leaders of the Muslims, and to their common people"
Numbering
Darussalam 58
Bukhari 58