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: "To associate someone 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: "To kill your child out of fear that he will eat with you." The questioner asked: "After that?" He replied: "To commit 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 whom Allah has forbidden except by right, and do not commit adultery. Whoever does this shall meet a penalty."
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 4102