This Surah takes its name from v. 27.
As this Surah contains the characteristics of both the Makki and the Madani Surahs, the commentators have differed as to its period of revelation, but in the light of its style and themes we are of the opinion that a part of it (vv. 1-24) was sent down in the last stage of the Makki life of the Holy Prophet a little before migration and the rest (vv. 25-78) during the first stage of his Madani life. That is why this Surah combines the characteristics of both the Makki and the Madani Surahs.
The sudden change of the style from v. 25 shows that probably vv. 25-78 were sent down in the month of Zul-Hijjah in the very first year after Hijrah. This is indicated by vv. 25-41 and confirmed by the occasion of the revelation of vv. 39-40. It appears that the month of Zul-Hijjah must have brought to the immigrants nostalgic memories of their homes in Makkah and naturally they must have thought of their Sacred City and of their Hajj congregation there, and grieved to think that the mushrik Quraish had debarred them from visiting the Sacred Mosque. Therefore, they might even have been praying for and expecting Divine permission to wage war against those tyrants who had expelled them from their homes and deprived them of visiting the House of Allah and made it difficult for them to follow the way of Islam. It was at this psychological occasion that these verses were sent down. That is why the purpose for which Masjid-al- Haram was built has been specifically mentioned. It has been made plain that Hajj(pilgrimage) had been enjoined for the worship of One Allah. But it is an irony that afterwards it had been dedicated to the rituals of shirk and the worshipers of One Allah had been debarred from visiting it. Therefore, permission for waging war against those tyrants has been given to oust them from there and to establish the righteous way of life for establishing virtue and eradicating evil. According to Ibn Abbas, Mujahid, Urwah bin Zubair, Zaid bin Aslam, Muqatil bin Hayyan, Qatadah and other great commentators, v. 39 is the first verse that grants the Muslims permission to wage war. Collections of Hadith and books on the life of the Holy Prophet confirm that after this permission actual preparations for war were started and the first expedition was sent to the coast of the Red Sea in Safar A.H. 2, which is known as the Expedition of Waddan or Al- Abwa.
This Surah is addressed to: (1) The mushriks of Makkah, (2) the wavering Muslims, and (3) the True Believers. The mushriks have been warned in a forceful manner to this effect: "You have obdurately and impudently persisted in your ideas of ignorance and trusted in your deities instead of Allah, though they possess no power at all and you have repudiated the Divine Messenger. Now you will meet the same end as has been the doom of those like you before. You have only harmed yourselves by rejecting Our Prophet and by persecuting the best element of your own community; now your false deities shall not be able to save you from the wrath of God". At the same time, they have been admonished time and again for their creed of shirk and sound arguments have been given in favor of Tauhid and the Hereafter.
The wavering Muslims, who had embraced Islam but were not prepared to endure any hardship in its way, have been admonished to this effect: "What is this faith of yours? On the one hand, you are ready to believe in Allah and become His servants provided you are given peace and prosperity but, on the other, if you meet with afflictions and hardships in His Way, you discard your Allah and cease to remain His servant. You should bear in mind that this wavering attitude of yours cannot avert those misfortunes and losses which Allah has ordained for you."
As regards the true Believers, they have been addressed in two ways: (1) in a general way so as to include the common people of Arabia also, and (2) in an exclusive way:
The Believers have been told that the mushriks of Makkah had no right to debar them from visiting the Holy Mosque. They had no right to prevent anyone from performing Hajj because the Holy Mosque was not their private property. This objection was not only justified but it also acted as an effective political weapon against the Quraish. For it posed this question to the other clans of Arabia: Were the Quraish mere attendants of the Holy Mosque or its owners? It implied that if they succeeded in debarring the Muslims from Hajj without any protest from others, they would feel encouraged in future to debar from Hajj and Umrah the people of any other clan, who happened to have strained relations with the Quraish. In order to emphasize this point, the history of the construction of the Holy Mosque has been cited to show that it was built by Prophet Abraham by the Command of Allah and he had invited all the peoples to perform Hajj there. That is why those coming from outside had enjoyed equal rights by the local people from the very beginning. It has also been made clear that that House had not been built for the rituals of shirk but for the worship of One Allah. Thus it was sheer tyranny that the worship of Allah was being forbidden there while the worship of idols enjoyed full license.
In order to counteract the tyranny of the Quraish, the Muslims were allowed to fight with them. They were also given instructions to adopt the right and just attitude as and when they acquired power to rule in the land. Moreover, the Believers have been officially given the name of "Muslims", saying, "You are the real heirs to Abraham and you have been chosen to become witnesses of the Truth before mankind. Therefore you should establish salat and pay the zakat dues in order to become the best models of righteous life and perform Jihad for propagating the Word of Allah." (vv. 41,77, 78.)
It will be worth while to keep in view the introductions to Chapters II (Al-Baqarah) and VIII (Al Anfal).
Source: Sayyid Abul Ala Maududi - Tafhim al-Qur'an - The Meaning of the Quran
وَإِذْ بَوَّأْنَا لِإِبْرَاهِيمَ مَكَانَ الْبَيْتِ أَن لَّا تُشْرِكْ بِي شَيْئًا وَطَهِّرْ بَيْتِيَ لِلطَّائِفِينَ وَالْقَائِمِينَ وَالرُّكَّعِ السُّجُودِ
وَأَذِّن فِي النَّاسِ بِالْحَجِّ يَأْتُوكَ رِجَالًا وَعَلَىٰ كُلِّ ضَامِرٍ يَأْتِينَ مِن كُلِّ فَجٍّ عَمِيقٍ
لِّيَشْهَدُوا مَنَافِعَ لَهُمْ وَيَذْكُرُوا اسْمَ اللَّهِ فِي أَيَّامٍ مَّعْلُومَاتٍ عَلَىٰ مَا رَزَقَهُم مِّن بَهِيمَةِ الْأَنْعَامِ ۖ فَكُلُوا مِنْهَا وَأَطْعِمُوا الْبَائِسَ الْفَقِيرَ
ثُمَّ لْيَقْضُوا تَفَثَهُمْ وَلْيُوفُوا نُذُورَهُمْ وَلْيَطَّوَّفُوا بِالْبَيْتِ الْعَتِيقِ
ذَٰلِكَ وَمَن يُعَظِّمْ حُرُمَاتِ اللَّهِ فَهُوَ خَيْرٌ لَّهُ عِندَ رَبِّهِ ۗ وَأُحِلَّتْ لَكُمُ الْأَنْعَامُ إِلَّا مَا يُتْلَىٰ عَلَيْكُمْ ۖ فَاجْتَنِبُوا الرِّجْسَ مِنَ الْأَوْثَانِ وَاجْتَنِبُوا قَوْلَ الزُّورِ