Quran 4:104 And don’t be weak in the pursuit of the enemy; if you are suffering (hardships) then surely, they (too) are suffering (hardships) as you are suffering, but you have a hope from Allah (for the reward, i.e. Paradise) that for which they hope not, and Allah is Ever All-Knowing, All-Wise.
Surah 4, is a Medinan chapter. This above verse is addressing Muslims 1400 years ago for the importance of fighting against the disbelievers who oppress men, women and children. Quranic passage 1:104 encourages Muslims to endure their struggles with hope and not to give up fighting the enemy, who constantly persecute the Muslim community at the time when Prophet Muhammed (p) was alive. Moreover, the above Quranic passage is subject to other verses which Muslims must follow. That they only fight the enemy if they’re under attack or if the enemy does not cease from hostilities. Read the following verses,
Quran 2:190 – Fight in the way of Allah against those who fight against you, but begin not hostilities. Lo! Allah loves not aggressors.
Quran 42:39 – And those who, when great wrong is done to them, defend themselves.
Quran 22:39-40 – (39) Permission [to fight] is given to those against whom war is being wrongfully waged ? and, verily Allah indeed has the power to help them; (40) those who have been driven from their homes unjustly only because they said: Our Rabb (Sustainer, Cherisher) is Allah. For had it not been for Allah repelling some men by means of others, monasteries, churches, synagogues and mosques, wherein the name of Allah is oft mentioned, would assuredly been destroyed. Surely, Allah helps him who helps Allah. Lo! Allah is Strong, Almighty.
Muslims are only allowed to fight back in order to be liberated from tyrants. So that they can practice their religion freely without being subject to abuse, oppression. Ar-Raheeq Al-Makhtum (The Sealed Nectar) – Saifur Rahman al-Mubarakpuri
The verse explicitly identifies both attitudes as regards losses and hardships as identical. Both parties concluded the war operations and went back neither victorious nor vanquished. 
[1 ] Ar-Raheeq Al-Makhtum (The Sealed Nectar) by Saifur Rahman al-Mubarakpuri page 131