The history of the India begins with the Indus Valley Civilization, which spread and flourished in the north-western part of the Indian subcontinent, from 3300 to 1700 BCE. This Bronze Age civilization was followed by the Iron Age Vedic period, which witnessed the rise of major kingdoms known as the Mahajanapadas. In two of these, in the 6th century BCE, Mahavira and Gautama Buddha were born.
The Indus Valley Civilization collapsed in the middle of the second millennium BCE and was followed by the Vedic Civilization, which extended over much of the Indo-Gangetic plains. Successive empires and kingdoms ruled the region from the Achaemenid Persian empire around 543 BCE, to Alexander the Great in 326 BCE and the Mauryan empire. The Indo-Greek Kingdom founded by Demetrius of Bactria included Gandhara and Punjab from 184 BCE, and reached its greatest extent under Menander, establishing the Greco-Buddhist period with advances in trade and culture.
The subcontinent was united under the Maurya Empire during the 4th and 3rd centuries BCE. It subsequently became fragmented, with various parts ruled by numerous Middle kingdoms for the next ten centuries. Its northern regions were united once again in the 4th century CE, and remained so for two centuries thereafter, under the Gupta Empire. This period was known as the "Golden Age of India." During the same time, and for several centuries afterwards, Southern India, under the rule of the Chalukyas, Cholas, Pallavas and Pandyas, experienced its own Golden Age, during which Hinduism and Buddhism spread to much of south-east Asia.
Islam arrived on the subcontinent in 712 CE, when the Arab general Muhammad bin Qasim conquered Sindh and Multan in southern Punjab, setting the stage for several successive Islamic invasions between the 10th and 15th centuries CE from Central Asia, leading to the formation of Muslim empires in the Indian subcontinent, including the Ghaznavid, the Ghorid, the Delhi Sultanate and the Mughal Empire. Mughal rule came to cover most of the northern parts of the subcontinent. Mughal rulers introduced middle-eastern art and architecture to India. In addition to the Mughals, several independent Hindu kingdoms, such as the Maratha Empire, the Vijayanagara Empire and various Rajput kingdoms, flourished contemporaneously, in Western and Southern India respectively. The Mughal Empire suffered a gradual decline in the early eighteenth century, which provided opportunities for the Afghans, Balochis and Sikhs to exercise control over large areas in the northwest of the subcontinent until the British East India Company gained ascendancy over South Asia.
Beginning in the mid-18th century and over the next century, India was gradually annexed by the British East India Company. Dissatisfaction with Company rule led to the First War of Indian Independence, after which India was directly administered by the British Crown and witnessed a period of both rapid development of infrastructure and economic decline.
During the first half of the 20th century, a nationwide struggle for independence was launched by the Indian National Congress, and later joined by the Muslim League. The subcontinent gained independence from Great Britain in 1947, after being partitioned into the dominions of India and Pakistan. Pakistan's eastern wing became the nation of Bangladesh in 1971.