‘Uqbah bin Abi Mu‘ait was the close friend of Ubayy bin Khalaf. On one occasion, ‘Uqbah came to Rasulullah (sallallahu ‘alaihi wasallam) and sat in his company for some time, listening to his message of deen. When Ubayy learnt of this, he immediately came to ‘Uqbah and said, “I have learnt that you sat in the company of Muhammed (sallallahu ‘alaihi wasallam), attentively listening to his words. By Allah! Until you do not go and spit on his face, it is haraam for me to talk to you and even look at your face!”
Accordingly, the wretched ‘Uqbah rose, went to Rasulullah (sallallahu ‘alaihi wasallam) and spat his saliva onto his blessed face. It was in regard to this that the following verses of the Qur’aan Majeed were revealed:
وَ یَوۡمَ یَعَضُّ الظَّالِمُ عَلٰی یَدَیۡہِ یَقُوۡلُ یٰلَیۡتَنِی اتَّخَذۡتُ مَعَ الرَّسُوۡلِ سَبِیۡلًا ﴿۲۷﴾ یٰوَیۡلَتٰی لَیۡتَنِیۡ لَمۡ اَتَّخِذۡ فُلَانًا خَلِیۡلًا ﴿۲۸﴾ لَقَدۡ اَضَلَّنِیۡ عَنِ الذِّکۡرِ بَعۡدَ اِذۡ جَآءَنِیۡ ؕ وَ کَانَ الشَّیۡطٰنُ لِلۡاِنۡسَانِ خَذُوۡلًا ﴿۲۹﴾ وَ قَالَ الرَّسُوۡلُ یٰرَبِّ اِنَّ قَوۡمِی اتَّخَذُوۡا ہٰذَا الۡقُرۡاٰنَ مَہۡجُوۡرًا ﴿۳۰﴾ وَ کَذٰلِکَ جَعَلۡنَا لِکُلِّ نَبِیٍّ عَدُوًّا مِّنَ الۡمُجۡرِمِیۡنَ ؕ وَ کَفٰی بِرَبِّکَ ہَادِیًا وَّ نَصِیۡرًا ﴿۳۱﴾
And the day when the evil-doer will bite his hands (in despair) saying, “Oh! If only I had taken the path of the Messenger! Ah! Woe unto me! If only I did not take so-and-so as an intimate friend. He indeed led me astray from the zikr (the message of the Qur’aan) after it had come to me.” and shaitaan is indeed a deserter to man (in the hour of need). And the messenger said, “O my Lord! My people have discarded (the teachings of) this Qur’aan.” (O Nabi! Do not become despondent because) in this manner, We have assigned to every Nabi an enemy from among the crminals. Your Lord is sufficient as a guide and a helper. (Surah Furqaan v. 27-31)
‘Uqbah was captured as a prisoner in the Battle of Badr and was executed in a place name Safraa.
(Extracted from Seeratul Mustafa 1/216-217)