Sayyiduna Ibn Abbas (may Allah be pleased with them both) says, regarding the saying of Allah, the Mighty and Majestic: "When the help of Allah and the victory come" [Surah al-Nasr: 1]: "In it, the Messenger of Allah (peace and blessings be upon him) was informed of his own death." It was revealed to him (peace and blessings be upon him): "When the help of Allah and the victory come" [Surah al-Nasr: 1], "meaning the conquest of Makkah, then seek forgiveness from your Lord, and know that your appointed time has come."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12392