The arrival of the Arab Muslims to the provinces of Sindh and Punjab, along with subsequent Muslim dynasties, set the religious boundaries of South Asia. This would lead to the development of the modern state of Pakistan as well as forming the foundation for Islamic rule across much of South Asia. Following the rule of various Islamic empires, including the Ghaznavid Empire, the Ghorid kingdom, and the Delhi Sultanate, the Mughals controlled the region from 1526 until 1739. Muslim technocrats, bureaucrats, soldiers, traders, scientists, architects, teachers, theologians and Sufis flocked from the rest of the Muslim world to Islamic Sultanate and Mughal Empire in South Asia.