A man asked, "Messenger of Allah, which sin is greatest in the sight of Allah?"He replied, "That you set up a rival to Allah, when it is He who created you."The man asked, "Then which?"He said, "That you kill your child out of fear that he will eat with you."The man asked, "Then which?"He said, "That you commit adultery with your neighbor's wife."Then Allah revealed a verse confirming this, "And those who do not invoke another god alongside Allah, nor kill the soul that Allah has forbidden except by right, nor commit adultery. Whoever does that will meet a penalty" [Furqan 25:68].
قال رجل: يا رسول الله أي الذنب أكبر عند الله؟ قال: أن تدعو الله ندا وهو خلقك قال: ثم أي؟ قال: ثم أن تقتل ولدك خشية أن يطعم معك قال: ثم أي؟ قال: ثم أن تزاني حليلة جارك فأنزل الله تصديقها {والذين لا يدعون مع الله إلها واخر ولا يقتلون النفس التي حرم الله إلا بالحق ولا يزنون ومن يفعل ذلك يلق أثاما} [الفرقان: ٦٨].
Bukhari narrated it in the Book of Diyat (6861), and Muslim narrated it in the Book of Iman (86:142), both through the route of Jareer, from Amash, from Abu Waail, from Amr bin Shurahbil, who said, Abdullah said, and he mentioned it.