Allaah (The Most High) said:
أَلَمۡ تَرَ كَيۡفَ فَعَلَ رَبُّكَ بِأَصۡحَـٰبِ ٱلۡفِيلِ
أَلَمۡ يَجۡعَلۡ كَيۡدَهُمۡ فِى تَضۡلِيلٍ۬
وَأَرۡسَلَ عَلَيۡہِمۡ طَيۡرًا أَبَابِيلَ
تَرۡمِيهِم بِحِجَارَةٍ۬ مِّن سِجِّيلٍ۬
فَجَعَلَهُمۡ كَعَصۡفٍ۬ مَّأۡڪُولِۭ
”Have you (O Muhammad) not seen how your Lord dealt with the Owners of the Elephant? [The elephant army which came from Yemen under the command of Abrahah Al-Ashram intending to destroy the Ka’bahat Makkah]. Did He not make their plot go astray? And sent against them birds, in flocks, Striking them with stones of Sijjil. And made them like an empty field of stalks (of which the corn has been eaten up by cattle).”
The story of the army of the Elephants
This incident happened during the period of the birth-year of Prophet Muhammad (sallal-laahu-alayhi-wasallam). Abrahah Al-Ashram was the governor of Yemen on behalf of the king of Ethiopia (as Yemen was a part of the Ethiopian Kingdom). He (Abrahah) thought to build a house (like the Ka?bah at Makkah) in San?a (the capital of Yemen) and call the Arabs to perform the pilgrimage there in San?a instead of the Ka?bah (Al-Bait Al Haraam) in Makkah, with the intention of diverting the trade and benefits from Makkah to Yemen.
He presented his idea to the king of Ethiopia who agreed to his idea. So the house (church) was built and he named it Al-Qullais; there was no church of its like at the time. Then a man from the Quraish tribe of Makkah came there and was infuriated by it, so he relieved his nature (stools and urine) in it, soiled its walls and went away. When Abrahah Al-Ashram saw that, he could not control his anger and raised an army to invade Makkah and demolish the ka?bah.
He had in that army thirteen elephants and amongst them was an elephant called Mahmood which was the biggest of them. So that army proceeded and none amongst the Arab tribes that faced them (fought against them) but was killed and defeated, till it approached near Makkah. Then there took place negotiations between Abrahah Al-Ashram and the chief of Makkah (Abdul Muttalib Bin Haashim, the grandfather of the Prophet (sallal-laahu-alayhi-wasallam), and it was concluded that Abrahah would restore the camels of Abdul Muttalib which he had taken away, and then he (Abrahah Al-Ashram) would decide himself as regards the Ka?bah. Abdul Mutallib ordered the men of Makkah to evacuate the city and go to the top of the mountains along with their wives and children in case some harm should come to them from the INVADING OPPRESSORS.
Then that army moved towards Makkah till they reached valley Muhassir. While the army was marching towards Makkah, in the middle of the valley, suddenly it was overtaken by flocks of birds, flocks after flocks, air-raiding that army with small stones slightly bigger than a lentil seed. There never fell a stone on a soldier except it dissolved his flesh and burst it into pieces. So they perished with a total destruction. Abrahah Al-Ashram fled away while his flesh was bursting into pieces till he died on the way (back to Yemen).
Such was the victory bestowed by Allaah (The All-Majestic, All Powerful) to the people of Makkah and such was the protection provided by Him for The Kabah.
[Source: Footnotes: Translation of the meanings of the Noble Qur’aan by Dr. Muhammad Taqi-ud-Deen Al Hilaali and Dr. Muhammad Muhsin Khan.