Arab armies had earlier tried to penetrate deep into South Asia but were defeated by the South Indian Emperor Vikramaditya II of the Chalukya dynasty, South Indian general Dantidurga of the Rashtrakuta dynasty in Gujarat, and by Nagabhata of the Pratihara Dynasty in Malwa in the early 8th century.