It was Pharaoh who had summoned them, selecting them from every deep ravine and distant valley, from the great cities of Egypt and its outskirts, from both urban centers and rural villages.
Allah the Exalted says in Sūrat al-Aʿrāf:
“Then, after them, We sent Moses with Our signs to Pharaoh and his chiefs, but they wronged them. So behold how was the end of the corrupters. (103)
Moses said, ‘O Pharaoh, I am a messenger from the Lord of all worlds, (104)
obliged to say nothing about Allah except the truth. I have come to you with a clear proof from your Lord, so send the Children of Israel with me.’ (105)
He said, ‘If you have brought a sign, then present it, if you are indeed truthful.’ (106)
So he threw down his staff, and behold, it became a clearly visible serpent; (107)
and he drew out his hand, and behold, it was white for the onlookers. (108)
The chiefs of Pharaoh’s people said, ‘This is surely a learned magician (109)
who wants to expel you from your land; so what do you command?’ (110)
They said, ‘Postpone him and his brother and send heralds to the cities (111)
who will bring you every skilled magician.’ (112)
The magicians came to Pharaoh and said, ‘Shall we indeed have a reward if we are the victors?’ (113)
He said, ‘Yes, and you will surely be among those brought near.’ (114)
They said, ‘O Moses, will you cast, or shall we be the ones to cast?’ (115)
He said, ‘Cast.’ And when they cast, they bewitched the people’s eyes, struck them with awe, and produced a mighty magic. (116)
We revealed to Moses: ‘Cast your staff,’ and behold, it devoured what they had fabricated. (117)
Thus the truth was established and what they had been doing was nullified. (118)
So they were defeated there and turned back humiliated, (119)
and the magicians fell down in prostration. (120)
They said, ‘We believe in the Lord of the worlds, (121)
—the Lord of Moses and Aaron.’ (122)
Pharaoh said, ‘You believed in Him before I gave you permission? This is a plot you have contrived in the city to drive out its people; but you will soon know. (123)
I shall surely cut off your hands and feet on opposite sides, then crucify you all.’ (124)
They said, ‘Indeed, to our Lord we will return. (125)
You only take revenge on us because we believed in the signs of our Lord when they came to us. Our Lord, pour upon us patience and cause us to die as Muslims.’ (126)”
And He, exalted is He, says in Sūrat Yūnus:
“Then, after them, We sent Moses and Aaron to Pharaoh and his chiefs with Our signs, but they grew arrogant and were a criminal people. (75)
When the truth came to them from Us they said, ‘This is obvious sorcery.’ (76)
Moses said, ‘Do you say of the truth when it has come to you that it is sorcery? Sorcerers never prosper.’ (77)
They said, ‘Have you come to turn us away from that upon which we found our fathers, so that greatness may belong to you and your brother in the land? We will never believe in the two of you.’ (78)
Pharaoh said, ‘Bring me every skilled magician.’ (79)
When the magicians came, Moses said to them, ‘Cast whatever you will cast.’ (80)
When they had cast, Moses said, ‘What you have brought is sorcery. Allah will surely invalidate it; indeed, Allah does not set right the work of those who spread corruption. (81)
And Allah will establish the truth by His words, though the criminals may loathe it.’ (82)”
And He, glorified be He, says in Sūrat ash-Shuʿarāʾ:
“[Pharaoh] said, ‘If you take a god other than me, I will surely make you one of the imprisoned.’ (29)
Moses said, ‘Even if I bring you something manifest?’ (30)
He said, ‘Then bring it, if you are of the truthful.’ (31)
So he threw his staff, and behold, it turned into a clear serpent; (32)
and he drew out his hand, and behold, it was white for the beholders. (33)
Pharaoh said to the nobles around him, ‘This is indeed a learned magician (34)
who wants to expel you from your land by his magic; so what do you command?’ (35)
They said, ‘Postpone him and his brother, and send into the cities gatherers (36)
who will bring you every expert magician.’ (37)
So the magicians were assembled at an appointed time on a well-known day, (38)
and it was said to the people, ‘Will you gather, (39)
so that we may follow the magicians if they are the victors?’ (40)
When the magicians came they said to Pharaoh, ‘Shall we surely have a reward if we are the victors?’ (41)
He said, ‘Yes—and in that case you will certainly be among those near to me.’ (42)
Moses said to them, ‘Cast what you will cast.’ (43)
They threw down their ropes and staffs and said, ‘By the might of Pharaoh, we shall indeed be the victors!’ (44)
Then Moses threw his staff, and behold, it swallowed up what they had fabricated. (45)
So the magicians fell down in prostration (46)
and said, ‘We believe in the Lord of the worlds, (47)
the Lord of Moses and Aaron.’ (48)
[Pharaoh] said, ‘You believed in him before I gave you permission? He is surely your chief who taught you magic; but you will soon know—I shall certainly cut off your hands and feet on opposite sides…’ (49)