When the Prophet ﷺ was driven out of Mecca, a man said, "They have driven out their prophet!" So the verse was revealed, "Permission to fight has been given to those against whom war is being waged, because they have been wronged, and indeed Allah is fully capable of granting them victory. They are those who have been driven out of their homes without right" [Hajj 22:39–40], referring to the Prophet ﷺ and his companions.
حدثنا محمد بن بشار حدثنا أبو أحمد الزبيري حدثنا سفيان عن الأعمش عن مسلم البطين
لما أخرج النبي ﷺ من مكة قال رجل أخرجوا نبيهم فنزلت {أذن للذين يقاتلون بأنهم ظلموا وإن الله على نصرهم لقدير الذين أخرجوا من ديارهم بغير حق} النبي ﷺ وأصحابه