Allah said,
[وَقَاتِلُواْ 
الْمُشْرِكِينَ كَآفَّةً]
(and fight against the idolaters collectively), all of you,
[كَمَا 
يُقَـتِلُونَكُمْ كَآفَّةً]
(as they fight against you collectively.), all of them,
[وَاعْلَمُواْ أَنَّ 
اللَّهَ مَعَ الْمُتَّقِينَ]
(But know that Allah is with those who have Taqwa), and know that initiating 
battle during the Sacred Months is forbidden. Allah said in other Ayat,
[يَـأَيُّهَا 
الَّذِينَ ءَامَنُواْ لاَ تُحِلُّواْ شَعَآئِرَ اللَّهِ وَلاَ الشَّهْرَ 
الْحَرَامَ]
(O you who believe! Violate not the sanctity of the symbols of Allah, nor of 
the sacred month.) [5:2],
[الشَّهْرُ 
الْحَرَامُ بِالشَّهْرِ الْحَرَامِ وَالْحُرُمَـتُ قِصَاصٌ فَمَنِ اعْتَدَى 
عَلَيْكُمْ فَاعْتَدُواْ عَلَيْهِ بِمِثْلِ مَا اعْتَدَى عَلَيْكُمْ]
(The Sacred Month is for the Sacred Month, and for the prohibited things, 
there is the law of equality (Qisas). Then whoever transgresses the prohibition 
against you, you transgress likewise against him) [2:194], and,
[فَإِذَا انسَلَخَ 
الأَشْهُرُ الْحُرُمُ فَاقْتُلُواْ الْمُشْرِكِينَ]
(Then when the Sacred Months have passed, kill the idolators...) [9:5]. As 
for Allah's statement,
[وَقَاتِلُواْ 
الْمُشْرِكِينَ كَآفَّةً كَمَا يُقَـتِلُونَكُمْ كَآفَّةً]
(And fight against the idolators collectively as they fight against you 
collectively), it includes permission for the believers to fight the idolators 
in the Sacred Month, if the idolators initiate hostilities therein. Allah said 
in other Ayat,
[الشَّهْرُ 
الْحَرَامُ بِالشَّهْرِ الْحَرَامِ وَالْحُرُمَـتُ قِصَاصٌ]
(The Sacred Month is for the Sacred Month, and for the prohibited things, 
there is the law of equality (Qisas)) [2:194], and,
[وَلاَ 
تُقَـتِلُوهُمْ عِندَ الْمَسْجِدِ الْحَرَامِ حَتَّى يُقَـتِلُوكُمْ فِيهِ فَإِن 
قَـتَلُوكُمْ فَاقْتُلُوهُمْ]
(And fight not with them at Al-Masjid Al-Haram, unless they (first) fight you 
there. But if they attack you, then kill them.) [2:191]. As for the Messenger of 
Allah laying siege to At-Ta'if until the Sacred Month started, it was a 
continuation of the battle against Hawazin and their allies from Thaqif. They 
started the fighting and gathered their men for the purpose of conducting war. 
The Messenger of Allah marched to meet them and when they took refuge in 
At-Ta'if, the Prophet laid siege to them so that they descend from their forts, 
but they inflicted casualties on Muslims. The siege continued for about forty 
days, during which a Sacred Month began, and the siege continued for several 
days in that month. The Messenger broke the siege and went back (to Makkah). So 
fighting that carries over into it [the Sacred Month] is not the same as 
initiating warfare during it, Allah knows best.
[إِنَّمَا النَّسِىءُ 
زِيَادَةٌ فِى الْكُفْرِ يُضَلُّ بِهِ الَّذِينَ كَفَرُواْ يُحِلُّونَهُ عَامًا 
وَيُحَرِّمُونَهُ عَامًا لِّيُوَاطِئُواْ عِدَّةَ مَا حَرَّمَ اللَّهُ فَيُحِلُّواْ 
مَا حَرَّمَ اللَّهُ زُيِّنَ لَهُمْ سُوءُ أَعْمَـلِهِمْ وَاللَّهُ لاَ يَهْدِي 
الْقَوْمَ الْكَـفِرِينَ ]
(37. The postponing (of a Sacred Month) is indeed an addition to disbelief: 
thereby the disbelievers are led astray, for they make it lawful one year and 
forbid it another year in order to adjust the number of months forbidden by 
Allah, and make such forbidden ones lawful. The evil of their deeds is made 
fair-seeming to them. And Allah guides not the people who disbelieve.)