Permission to take up arms is hereby given to those who are attacked because they have been oppressed – Allah indeed has power to grant them victory – those who have been unjustly driven from their homes, only because they said: "Our Lord is Allah" (22:39-40)
The verse permits, but does not command, armed struggle for those who have been attacked and compelled to leave their homes because of their beliefs. Several additional verses containing authorisation of defensive armed struggle when Muslims are attacked by non-believers and idolaters can be found in the Quran.