It is narrated from Sayyiduna Ibn Mas'ud (may Allah be pleased with him) that once someone asked the Prophet (peace and blessings be upon him): "Which sin is the greatest?" The Prophet (peace and blessings be upon him) replied: "Associating partners with Allah, especially when it is Allah Who created you." The questioner asked: "After that, which sin is the greatest?" The Prophet (peace and blessings be upon him) said: "Killing your child out of fear that he will eat with you." The questioner asked: "After that?" He replied: "Committing adultery with your neighbor's wife." Sayyiduna Ibn Mas'ud (may Allah be pleased with him) says that Allah Almighty revealed this verse in confirmation of this: «﴿وَالَّذِينَلَايَدْعُونَمَعَاللّٰهِإِلَهًاآخَرَوَلَايَقْتُلُونَالنَّفْسَالَّتِيحَرَّمَاللّٰهُإِلَّابِالْحَقِّوَلَايَزْنُونَوَمَنْيَفْعَلْذَلِكَيَلْقَأَثَامًا﴾ [الفرقان : 68]» "And those who do not associate anyone with Allah, and do not kill a soul which Allah has forbidden except by right, and do not commit adultery. And whoever does this will meet a penalty."
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 3612