Sayyiduna Ibn Mas'ud (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) came to me and said: "O Ibn Mas'ud!" I said: "Labbayk (at your service), O Messenger of Allah (peace and blessings be upon him)." He (peace and blessings be upon him) said it three times, (then he said:) "Do you know which is the firmest handhold of faith?" I said: "Allah and His Messenger know best." He (peace and blessings be upon him) said: "Indeed, the firmest handhold of Islam is friendship for His (Allah's) sake, love for His sake and hatred for His sake."
Then he (peace and blessings be upon him) said: "O Ibn Mas'ud!" I said: "Labbayk, O Messenger of Allah (peace and blessings be upon him)." He (peace and blessings be upon him) said it three times, (then) he said: "Do you know who is the best of people?" I said: "Allah and His Messenger know best." He (peace and blessings be upon him) said: "Indeed, the best person is the one who is best in deeds, when they have understanding of their religion."
Then he (peace and blessings be upon him) said: "O Ibn Mas'ud!" I said: "Labbayk, O Messenger of Allah (peace and blessings be upon him)." He (peace and blessings be upon him) said: "Do you know who is the most knowledgeable of people?" I said: "Allah and His Messenger know best." He (peace and blessings be upon him) said: "Indeed, the most knowledgeable of people is the one who sees the truth most clearly when people differ, even if he falls short in deeds, and even if he crawls along on his backside. Those before me split into seventy-two (72) sects; three of us were saved and all the rest perished. One sect confronted the kings and fought them for the sake of their own religion and the religion of Isa bin Maryam (peace be upon him), so they seized them, killed them and cut them apart with saws. And one sect did not have the strength to confront the kings, nor to remain among them calling them to the religion of Allah, the Mighty and Majestic, and the religion of Isa bin Maryam (peace be upon him), so they went out wandering in the land and adopted monasticism." He (peace and blessings be upon him) said: "And they are the ones about whom Allah, the Mighty and Majestic, said: 'And monasticism, which they innovated; We did not prescribe it for them' [Surah al-Hadid: 27] to the end of the verse." Then the Prophet (peace and blessings be upon him) said: "Whoever believed in me, affirmed me and followed me has observed it (monasticism) as it ought to be observed, and whoever did not follow me, those are the ones who perish."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10485