After their origin in Africa, anatomically modern humans first arrived on the Indian subcontinent between 73,000 and 55,000 years ago. Settled life, which involves the transition from foraging to farming and pastoralism, began in South Asia around 7,000 BCE. At the site of Mehrgarh, Balochistan, presence can be documented of the domestication of wheat and barley, rapidly followed by that of goats, sheep, and cattle. By 4,500 BCE, settled life had become more widely prevalent, and eventually evolved into the Indus Valley Civilization, an early civilization of the Old world, contemporaneous with Ancient Egypt and Mesopotamia. It flourished between 2,500 BCE and 1900 BCE in what today is Pakistan and north-western India, and was noted for its urban planning, baked brick houses, elaborate drainage, and water supply.
In the beginning of the second millennium BCE climate change, with persistent drought, led to the abandonment of the urban centers of the Indus Valley Civilisation. Its population resettled in smaller villages, and, in the north-west, mixed with Indo-Aryan tribes, who moved into the area in several waves of migration, also driven by the effects of this climate change. The Vedic period was marked by the composition of the Vedas, large collections of hymns of some of the Aryan tribes, whose postulated religious culture, through synthesis with the preexisting religious cultures of the subcontinent, gave rise to Hinduism. The caste system, which created a hierarchy of priests, warriors, and free peasants, but which excluded indigenous peoples by labeling their occupations impure, arose later during this period. Towards the end of the period, around the sixth century BCE, a second urbanisation took place with the consolidation of small kingdoms (janapadas) into larger states called mahajanapadas. This renewed urbanisation led to the rise of new ascetic or Śramaṇa movements, including Jainism and Buddhism, which challenged the orthodoxy of rituals, and gave rise to new religious concepts.
Most of the Indian subcontinent was conquered by the Maurya Empire during the 4th and 3rd centuries BCE. From the 3rd century BCE onwards Prakrit and Pali literature in the north and the Tamil Sangam literature in southern India started to flourish. Wootz steel originated in south India in the 3rd century BCE and was exported to foreign countries. During the Classical period, various parts of India were ruled by numerous dynasties for the next 1,500 years, among which the Gupta Empire stands out. This period, witnessing a Hindu religious and intellectual resurgence, is known as the classical or "Golden Age of India". During this period, aspects of Indian civilisation, administration, culture, and religion (Hinduism and Buddhism) spread to much of Asia, while kingdoms in southern India had maritime business links with the Middle East and the Mediterranean. Indian cultural influence spread over many parts of Southeast Asia, which led to the establishment of Indianised kingdoms in Southeast Asia (Greater India).
The most significant event between the 7th and 11th century was the Tripartite struggle centred on Kannauj that lasted for more than two centuries between the Pala Empire, Rashtrakuta Empire, and Gurjara-Pratihara Empire. Southern India saw the rise of multiple imperial powers from the middle of the fifth century, most notably the Chalukya, Chola, Pallava, Chera, Pandyan, and Western Chalukya Empires. The Chola dynasty conquered southern India and successfully invaded parts of Southeast Asia, Sri Lanka, the Maldives, and Bengal in the 11th century. In the early medieval period Indian mathematics, including Hindu numerals, influenced the development of mathematics and astronomy in the Arab world.
Islamic conquests made limited inroads into modern Afghanistan and Sindh as early as the 8th century, and the Delhi Sultanate was founded in 1206 CE by Central Asian Turks who ruled a major part of the northern Indian subcontinent in the early 14th century, but declined in the late 14th century. This period also saw the emergence of several powerful Hindu states, notably Vijayanagara, Gajapati, and Ahom, as well as Rajput states, such as Mewar. The 15th century saw the advent of Sikhism. The early modern period began in the 16th century, when the Mughal Empire conquered most of the Indian subcontinent, becoming the biggest global economy and manufacturing power, with a nominal GDP that valued a quarter of world GDP, superior than the combination of Europe's GDP. The Mughals suffered a gradual decline in the early 18th century, which provided opportunities for the Marathas, Sikhs, Mysoreans and Nawabs of Bengal to exercise control over large regions of the Indian subcontinent.
From the mid-18th century to the mid-19th century, large regions of India were gradually annexed by the East India Company, a chartered company acting as a sovereign power on behalf of the British government. Dissatisfaction with Company rule in India led to the Indian Rebellion of 1857, which rocked parts of north and central India, and let to the dissolution of the Company. India was afterwards ruled directly by the British Crown, in the British Raj. After World War I, a nationwide struggle for independence was launched by the Indian National Congress, led by Mahatma Gandhi, and noted for nonviolence. The British Indian Empire was partitioned in August 1947 into the Dominion of India and Dominion of Pakistan, each gaining its independence.