Sindh’s first known village settlements date as far back as 7000 BCE. Permanent settlements at Mehrgarh, currently in Balochistan, to the west expanded into Sindh. This culture blossomed over several millennia and gave rise to the Indus Valley Civilization around 3000 BCE. The Indus Valley Civilization rivalled the contemporary civilizations of Ancient Egypt and Mesopotamia in size and scope, numbering nearly half a million inhabitants at its height with well-planned grid cities and sewer systems.
In 712, Muhammad bin Qasim conquered the Sindh and Indus Valley, bringing South Asian societies into contact with Islam. Dahir was an unpopular Hindu king that ruled over a Buddhist majority and that Chach of Alor and his kin were regarded as usurpers of the earlier Buddhist Rai Dynasty, a view questioned by those who note the diffuse and blurred nature of Hindu and Buddhist practices in the region, especially that of the royalty to be patrons of both and those who believe that Chach may have been a Buddhist. The forces of Muhammad bin Qasim defeated Raja Dahir in alliance with the Hindu Jats and other regional governors.