Beta version. Kindly report any error in this text (specify the surah and aya numbers).

Quran arabic text from Tanzil.info licensed under the Creative Commons BY-ND 3.0 Unported license.

Request: Sura 9 Aya 5 to 5

فَإِذَا انْسَلَخَ الْأَشْهُرُ الْحُرُمُ فَاقْتُلُوا الْمُشْرِكِينَ حَيْثُ وَجَدْتُمُوهُمْ وَخُذُوهُمْ وَاحْصُرُوهُمْ وَاقْعُدُوا لَهُمْ كُلَّ مَرْصَدٍ ۚ فَإِنْ تَابُوا وَأَقَامُوا الصَّلَاةَ وَآتَوُا الزَّكَاةَ فَخَلُّوا سَبِيلَهُمْ ۚ إِنَّ اللَّهَ غَفُورٌ رَحِيمٌ {5}
[Shakir 9:5] So when the sacred months have passed away, then slay the idolaters wherever you find them, and take them captives and besiege them and lie in wait for them in every ambush, then if they repent and keep up prayer and pay the poor-rate, leave their way free to them; surely Allah is Forgiving, Merciful.
[Pickthal 9:5] Then, when the sacred months have passed, slay the idolaters wherever ye find them, and take them (captive), and besiege them, and prepare for them each ambush. But if they repent and establish worship and pay the poor-due, then leave their way free. Lo! Allah is Forgiving, Merciful.
[Yusufali 9:5] But when the forbidden months are past, then fight and slay the Pagans wherever ye find them, an seize them, beleaguer them, and lie in wait for them in every stratagem (of war); but if they repent, and establish regular prayers and practise regular charity, then open the way for them: for Allah is Oft-forgiving, Most Merciful.
[Pooya/Ali Commentary 9:5]

The command to fight against the perfidious and treacherous group of infidels who persistently violated the treaties and tried to destroy peace and security, was to restore law and order in the society. The command was not general but only refers to particular groups of the Makkan idolaters who were notorious offenders. They used to harass the Muslims whenever they found them helpless and when overpowered prayed for amnesty by making treaties which they used to break before their ink was dried.

When war becomes inevitable it must be fought with vigour. It may take the form of slaughter, or capture, or siege or ambush, but even then there is room for repentance and amendment, and if that takes place forgiveness is enjoined for the establishment of peace and harmony.