One day the Prophet ﷺ climbed Safa and called out, "Come quickly!" The Quraysh gathered around him and asked, "What is the matter with you?"He said, "Tell me, if I informed you that an enemy was going to attack you in the morning or in the evening, would you not believe me?"They replied, "Of course we would."He said, "Then I am a warner to you before the coming of a severe punishment."Abu Lahab said, "May you perish! Is this why you gathered us?"So Allah revealed, "The hands of Abu Lahab have perished" [Masad 111:1].
صعد النبي ﷺ الصفا ذات يوم فقال: يا صباحاه فاجتمعت إليه قريش قالوا: ما لك؟ قال: أرأيتم لو أخبرتكم أن العدو يصبحكم أو يمسيكم أما كنتم تصدقوني؟ قالوا: بلى. قال: فإني نذير لكم بين يدي عذاب شديد. فقال أبو لهب تبا لك ألهذا جمعتنا فأنزل الله: {تبت يدا أبي لهب}.
Bukhari related it in the tafsir (4801), and Muslim in the faith (208), both of them through Amash, from Amr bin Mura, from Saeed bin Jubayr, from Ibn Abbas, who narrated it. The wording given is Bukhari's, and Muslim's account is long.