The Arab conqueror Muhammad bin Qasim conquered Sindh in 711 CE. The Pakistan government's official chronology claims this as the time when the foundation of Pakistan was laid but the concept of Pakistan came in 19th century. The Early Medieval period (642–1219 CE) witnessed the spread of Islam in the region. During this period, Sufi missionaries played a pivotal role in converting a majority of the regional Buddhist and Hindu population to Islam. These developments set the stage for the rule of several successive Muslim empires in the region, including the Ghaznavid Empire (975–1187 CE), the Ghorid Kingdom, and the Delhi Sultanate (1206–1526 CE). The Lodi dynasty, the last of the Delhi Sultanate, was replaced by the Mughal Empire (1526–1857 CE).
The Mughals introduced Persian literature and high culture, establishing the roots of Indo-Persian culture in the region. From the region of modern-day Pakistan, key cities during the Mughal rule were Lahore and Thatta, both of which were chosen as the site of impressive Mughal buildings. In the early 16th century, the region remained under the Mughal Empire ruled by Muslim emperors. By the early 18th century, increasing European influence contributed to the slow disintegration of the Mughal Empire as the lines between commercial and political dominance became increasingly blurred.
During this time, the English East India Company had established coastal outposts. Control over the seas, greater resources, technology, and British military protection led the Company to increasingly flex its military muscle, allowing the Company to gain control over the subcontinent by 1765 and sideline European competitors. Expanding access beyond Bengal and the subsequent increased strength and size of its army enabled it to annex or subdue most of region by the 1820s. Many historians see this as the start of the region's colonial period. By this time, with its economic power severely curtailed by the British parliament and itself effectively made an arm of British administration, the Company began more deliberately to enter non-economic arenas such as education, social reform, and culture. Such reforms included the enforcement of the English Education Act in 1835 and the introduction of the Indian Civil Service (ICS). Traditional madrasahs—primary institutions of higher learning for Muslims in the subcontinent—were no longer supported by the English Crown, and nearly all of the madrasahs lost their financial endowment.