Sahih Muslim, Book 1, Hadith 108 (Muslim 199)

It is narrated on the authority of Jarir that he observed:

I owed allegiance to the Messenger of Allah (may peace and blessings be upon him) on hearing ( is commands) and obeying (them) and the Prophet) instructed me (to act) as lay in my power, and sincerity and goodwill for every Muslim.