(Say, (O Muhammad, to mankind): If ye love Allah…) [3:31]. Said al-Hasan ibn Jurayj: “Some people had claimed at the time of the Messenger of Allah, Allah bless him and give him peace, that they loved Allah. They said: 'O Muhammad! Verily, we love our Lord', and so Allah, exalted is He, revealed this verse”. Juwaybir also reported that al-Dahhak related that Ibn 'Abbas said: “The Prophet, Allah bless him and give him peace, saw the Quraysh in the Sacred Mosque prostrating to their idols which they erected therein, with eggs of ostriches hanging from them and earrings dangling from their ears. And so he said to them: 'O Quraysh! You have contravened the religion of your fathers Abraham and Ishmael, both of whom were Muslims'. They responded: 'O Muhammad! We worship them out of love for Allah and so that they bring us closer to Him'. Upon which Allah, exalted is He, revealed (Say, (O Muhammad, to mankind): If ye love Allah) and you worship your idols to bring you closer to Him, as you claim, then (follow me; Allah will love you…) for I am His Messenger to you, His proof against you, and I am more worthy of reverence than your idols”. Al-Kalbi also related from Abu Salih that Ibn 'Abbas said: “When the Jews said: 'We are the children of Allah and His beloved', Allah, exalted is He, revealed this verse. Then the Messenger of Allah, Allah bless him and give him peace, read it to the Jews but they refused to accept it”. Muhammad ibn Ishaq reported that Muhammad ibn Ja'far ibn al-Zubayr said: “This was revealed about the Christians of Najran, for they had said: 'We venerate and worship Christ out of love and veneration for Allah'. And so Allah, exalted is He, revealed this verse as a response”.
Asbab Al-Nuzul by Al-Wahidi , trans. Mokrane Guezzou