Northern India had been controlled after 550 CE by warring states, which had attempted to fill the vacuum created by the breakup of the Gupta Empire.
Among these were Yasodharman of Malwa, the Maitrakas of Vallabhi, and Emperor Harshavardhana of Thanesar.
Emperor Harshavardhana had brought the whole of North India under his control in the seventh century, but by the early eighth century, North India had once again divided into several kingdoms.
Muslims have meanwhile conquered much of West Asia.
The Umayyad Caliphate had attempted to conquer the frontier kingdoms of India—Kabul, Zabul, and Sindh—but were repulsed.
However, in 712 Umayyad general Muhammad ibn Qasim, the nephew of the famous general Al-Hajjaj, had conquered Sindh.
From Sindh, Umayyads had attempted to expand into Punjab but were defeated by Lalitaditya of Kashmir and Yasovarman of Kannauj.
Gurjara ruler Nagabhata I (730–756) extends his control east and south from Mandor, conquering Malwa as far as Gwalior and the port of Bharuch in Gujarat.
He has established his capital at Avanti in Malwa, and checks the expansion of the Arabs, who have established themselves in Sindh.
Junayd ibn Abd al-Rahman al-Murri, the successor of Muhammad ibn Qasim, had subdued Hindu resistance in Sindh, then attacked the smaller kingdoms of Western India in early 730 CE.
According to Indian records, al-Murri was only successful against the smaller states in Gujarat, and was defeated at two places.
The southern contingent moving south into Gujarat is defeated at Navsari by Avanijanashraya Pulakesi, who had been sent by Vikramaditya II, ruler of the South Indian Chalukya Empire.
The eastern contingent was defeated after reaching Avanti, by its ruler Nagabhata I.
According to Indian records the Umayyad armies were routed at the latter battle of Rajasthan, in which between five thousand and six thousand allied infantry and cavalry faced more than thirty thousand Arab troops.
The Rajputs under Bappa Rawal manage to kill the Arab leader Emir Junaid during the war.
The Rajput clans serve as a bulwark against the continuous threat of Muslim invasion.
The word "Pratihara" means doorkeeper, and will from this point be used by the Gurjara-Pratihara rulers as a self-designation.