إِنَّا امَنَّا بِرَبِّنَا لِيَغْفِرَ لَنَا خَطَايَانَا
...
Verily, we have believed in our Lord, that He may forgive us our faults,
"Whatever evils that we did."
It specifically means, `which we were forced to do of magic, in order to oppose the sign of Allah and the miracle of His Prophet.'
Ibn Abi Hatim recorded that Ibn Abbas said concerning Allah's statement,
وَمَا أَكْرَهْتَنَا عَلَيْهِ مِنَ السِّحْرِ
(and the magic to which you compelled us),
"Fir`awn took forty boys from the Children of Israel and commanded that they be taught magic at Al-Farama. He said, `Teach them knowledge that no one in the land knows."'
Ibn Abbas then said,
"They were of those who believed in Musa and they were of those who said,
امَنَّا بِرَبِّنَا لِيَغْفِرَ لَنَا خَطَايَانَا
وَمَا أَكْرَهْتَنَا عَلَيْهِ مِنَ السِّحْرِ
...
We have believed in our Lord, that He may forgive us our faults, and the magic to which you did compel us."
Abdur-Rahman bin Zayd bin Aslam said the same.
Allah's statement,
...
وَاللَّهُ خَيْرٌ وَأَبْقَى
And Allah is better as regards reward in comparison to your reward, and more lasting.
means, "He is better for us than you."
وَأَبْقَى
(and more lasting), More lasting in reward than what you promised us and made us aspire to.
It is apparent that Fir`awn (may Allah curse him) was bent upon their punishment, and that what he did to them was a mercy from Allah for them. This is why Ibn Abbas and others of the Salaf said,
"They woke up in that morning as magicians, but they became witnesses of faith by the evening."