Ghafir - 40:12

ذَلِكُم بِأَنَّهُ إِذَا دُعِيَ اللَّهُ وَحْدَهُ كَفَرْتُمْ وَإِن يُشْرَكْ بِهِ تُؤْمِنُوا فَالْحُكْمُ لِلَّهِ الْعَلِيِّ الْكَبِيرِ
[40:12]
That is because when Allah alone was called upon, you disbelieved, and when associates were given to Him, you believed; so judgment belongs to Allah, the High, the Great.
(The answer will be:) "This is because, when Allah was invoked as the Only (object of worship), ye did reject Faith, but when partners were joined to Him, ye believed! the Command is with Allah, Most High, Most Great!"
(It is said unto them): This is (your plight) because, when Allah only was invoked, ye disbelieved, but when some partner was ascribed to Him ye were believing. But the command belongeth only to Allah, the Sublime, the Majestic.