Wala ghaliba illa Allah

Wala ghaliba illa Allah (Arabic: ولا غالب إلا الله, "And there is no victor except Allah") is an Arabic phrase that was used as the motto of the Nasrid Emirate of Granada, the last Muslim state to rule parts of the Iberian Peninsula.

In the Quran
A similar phrase to "wala ghaliba illa Allah" is found in several surahs of the Quran, such as Surat Al-Imran and Surat Yusuf.

Theory of Almohad origin
There is a reference to the phrase in the book Rawd al-Qirtas by Ibn Abi Zara’ al-Fassi, where he described the victory of the Almohads, led by Yaqub al-Mansur, in the Battle of Alarcos over the Spanish Christian forces, led by Alfonso VIII of Castile. Ibn Abi Zara' said, "When Alfonso VIII - may God curse him - had decided to attack Muslims with his entire army... he heard the drums and the trumpets. He raised his head to look, and saw the banners of the Almohads approaching; in front of them was the victorious white banner, on which was written: (There is no God but Allah, Muhammad is the messenger of Allah, la ghaliba illa Allah.)"

Other theories
A second theory mentions that in the siege of Seville, the Castilians were aided by an unspecified Nasrid ruler of Granada. After the Castilian capture of Seville, crowds in Granada welcomed him saying, "The victor (has come)!" The ruler, who regretted aiding the Castilians, replied by saying, "There is no victor except Allah."

A third theory says that, due to the continuous infighting between the Muslims in Iberia, the Muslim populace knew that the end was near, so they started writing the phrase on walls and doors, to leave a mark for future generations to know that Islam once ruled their lands.

Usage
The phrase is usually seen in buildings in Southern Iberia that date back to the late periods of Islamic rule, such as the Alhambra palace.