The history of Pakistan preceding the country's independence in 1947 is shared with that of Afghanistan, India, and Iran. Spanning the western expanse of the Indian subcontinent and the eastern borderlands of the Iranian plateau, the region of present-day Pakistan served both as the fertile ground of a major civilization and as the gateway of South Asia to Central Asia and the Near East.
Situated on the first coastal migration route of Homo sapiens out of Africa, the region was inhabited early by modern humans. The 9,000-year history of village life in South Asia traces back to the Neolithic (7000–4300 BCE) site of Mehrgarh in Pakistan, and the 5,000-year history of urban life in South Asia to the various sites of the Indus Valley Civilization, including Mohenjo Daro and Harappa.