Allah says in surah al-Furqan:
وَيَوْمَ يَعَضُّ الظَّالِمُ عَلَىٰ يَدَيْهِ يَقُولُ يَا لَيْتَنِي اتَّخَذْتُ مَعَ الرَّسُولِ سَبِيلًا * يَا وَيْلَتَىٰ لَيْتَنِي لَمْ أَتَّخِذْ فُلَانًا خَلِيلًا * لَّقَدْ أَضَلَّنِي عَنِ الذِّكْرِ بَعْدَ إِذْ جَاءَنِي ۗ وَكَانَ الشَّيْطَانُ لِلْإِنسَانِ خَذُولًا * وَقَالَ الرَّسُولُ يَا رَبِّ إِنَّ قَوْمِي اتَّخَذُوا هَٰذَا الْقُرْآنَ مَهْجُورًا * وَكَذَٰلِكَ جَعَلْنَا لِكُلِّ نَبِيٍّ عَدُوًّا مِّنَ الْمُجْرِمِينَ ۗ وَكَفَىٰ بِرَبِّكَ هَادِيًا وَنَصِيرًا
And on the day that the wrongdoer will bite his hand, he will say, “O, if only I had taken a path with the Messenger! * O woe is me, if only I had not taken so-and-so as a close friend! * He took me off course from the reminder after it had come to me.” And the shaytaan is a deserter of man. * And the Messenger said, “O Lord, my people have taken this Qur’an as something to be discarded!” * Likewise We have made an enemy out of the criminals for every prophet. And your Lord is sufficient as a guide and protector. [25:27-31]
Commenting on this, Imam Abu Muhammad al-Husayn al-Baghawi wrote:
ـ ( ويوم يعض الظالم على يديه ) أراد بالظالم عقبة بن أبي معيط ، وذلك أن عقبة كان لا يقدم من سفر إلا صنع طعاما فدعا إليه أشراف قومه ، وكان يكثر مجالسة النبي – صلى الله عليه وسلم – فقدم ذات [ ص: 81 ] يوم من سفر فصنع طعاما فدعا الناس ودعا رسول الله – صلى الله عليه وسلم – ، فلما قرب الطعام قال رسول الله – صلى الله عليه وسلم – : ” ما أنا بآكل طعامك حتى تشهد أن لا إله إلا الله وأني رسول الله ” فقال عقبة : أشهد أن لا إله إلا الله وأن محمدا رسول الله ، فأكل رسول الله – صلى الله عليه وسلم – من طعامه ، وكان عقبة صديقا لأبي بن خلف ، فلما أخبر أبي بن خلف قال له : يا عقبة صبأت قال : لا والله ما صبأت ، ولكن دخل علي رجل فأبى أن يأكل طعامي إلا أن أشهد له ، فاستحييت أن يخرج من بيتي ولم يطعم ، فشهدت له فطعم ، فقال : ما أنا بالذي أرضى عنك أبدا إلا أن تأتيه فتبزق في وجهه ، ففعل ذلك عقبة ، فقال عليه السلام : ” لا ألقاك خارجا من مكة إلا علوت رأسك بالسيف ” فقتل عقبة يوم بدر صبرا . وأما أبي بن خلف فقتله النبي – صلى الله عليه وسلم – يوم أحد بيده ـ
وَيَوْمَ يَعَضُّ الظَّالِمُ عَلَىٰ يَدَيْهِ
And on the day that the wrongdoer will bite his hand …
The wrongdoer here is ‘Uqbah ibn Abi Mu’ayt. It used to be ‘Uqbah’s practice that whenever he would return from traveling, he would prepare a feast and invite the noblemen of his tribe, and he used to frequently host the Prophet.
One day, he returned from a trip, prepared a feast, and invited the people, including Allah’s Messenger. When he brought out the food, the Messenger of Allah said, “I will not eat any of your food until you bear witness that there is no deity worthy of worship besides Allah and that I am the Messenger of Allah,” so ‘Uqbah said, “I bear witness that there is no deity worthy of worship besides Allah and that Muhammad is the Messenger of Allah,” and so Allah’s Messenger ate his food.
Now, ‘Uqbah was a friend of Ubay ibn Khalaf, so when ‘Ubay ibn Khalaf heard about this, he said, “‘Uqbah, you have become a Sabee’!” ‘Uqbah said, “No, I swear I am not a Sabee’. It’s just that a man was my guest and he refused to eat my food unless I made this declaration for him. I was too shy to have him leave my house without having fed him anything, so I made the declaration of faith and then he ate.”
Ubay said, “I will never be happy with you again unless you go to him and spit on his face,” so ‘Uqbah went and did that. The Prophet then said, “If I meet you outside of Mecca, I will strike your head with a sword.” He was beheaded on the Day of Badr after having been captured, and as for Ubay ibn Khalaf, then the Prophet killed him on the Day of Uhud with his own hand.