It is narrated from Sayyiduna al-Bara' bin Azib (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The firmest handhold of faith is to love for the sake of Allah and to hate for the sake of Allah."
Imam Ahmad bin Hanbal (may Allah have mercy on him) recorded this hadith with these words: We were sitting with the Prophet (peace and blessings be upon him) when he (peace and blessings be upon him) asked: "Which handhold of Islam is the firmest?" The Companions (may Allah be pleased with them) said: "Prayer." He (peace and blessings be upon him) said: "It is a good quality, but it is not that (handhold sought)." They said: "Zakah." He (peace and blessings be upon him) said: "It too is excellent, but it is not that." They said: "Fasting in Ramadan." He (peace and blessings be upon him) said: "It too is good, but it is not that." They said: "Jihad." He (peace and blessings be upon him) said: "It too is a good deed, but it is not that." Then he (peace and blessings be upon him) himself said: "Indeed, the firmest handhold of faith is to love for the sake of Allah and to hate for the sake of Allah alone."
Imam Abu Dawud al-Tayalisi (may Allah have mercy on him) also recorded it,
and all these chains revolve around Layth bin Abi Sulaym (may Allah have mercy on him), and he is a da'if (weak) narrator.