It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him): the Prophet (peace and blessings be upon him) said: "By the One in whose Hand is my soul, Allah Almighty places His mercy only upon one who is merciful." The people said: "O Messenger of Allah, all of us show mercy." The Prophet (peace and blessings be upon him) said: "What is meant is not that one of you shows mercy to his companion; rather, what is meant is showing mercy to all people."
Abu Ya'la recorded it, and its narrators have been declared trustworthy, except that the narrator Ibn Ishaq is a mudallis.