Punjab was a region that formed parts of the Indus Valley civilization. The Aryans settled in this region in about 1500 B.C. It was in about 900 B.C. that the battle of Kurukshetra mentioned in the Epic Mahabharata was believed to have taken place in Kurukshetra. During this period the region formed small principalities ruled by chieftains. In 326 B.C. Alexander the Great of Macedonia invaded Punjab. After this was the rule of Chandragupta Maurya that lasted till about 1st century A.D. By 318 A.D. the Gupta dynasty exercised their influence. The Huns followed them in about 500 A.D. By 1000 A.D., the Muslims invaded Punjab led by Mahmud of Ghazni. In 1030 A.D., the Rajputs gained control of this territory. During the Sultanate period and Mughal rule, Punjab was engaged in intermittent warfare. In about 1192 A.D. the Ghoris defeated the Chauhans and ruled until the establishment of the Mughal rule.
Guru Gobind Singh (1661-1708 AD) created the Khalsa, an army of saint-warriors who rose up against the ferocity perpetrated by the Mugals. The Sikhs carried on their struggle and after the fall of Banda Bahadur, they established themselves as sovereign rulers of the greater part of the Punjab. From the misals evolved the government of Maharaja Ranjit Singh (1778-1839). He was the first independent native Indian ruler after the centuries of slavery. His reign, though not long, is significant because of its concept of dharma entwined with the practice of secularism. In the early, 19th century the British established their influence. After independence this region witnessed mass migration and distribution of property. In 1947 when India was partitioned, the larger half of Punjab went to Pakistan.
The mostly Muslim western part of the province became Pakistan’s Punjab Province; the mostly Sikh eastern part became India’s Punjab state. Many Sikhs and Hindus lived in the west, and many Muslims lived in the east and so the partition saw many people displaced and much intercommunal violence. Several small Punjabi princely states, including Patiala, also became part of India. In 1950, two separate states were created; Punjab included of the former Raj province of Punjab, while the princely states were combined into a new state, the Patiala and East Punjab States Union (PEPSU). PEPSU consisted of the princely states of Patiala, Nabha, Jind, Kapurthala, Malerkotla, Faridkot and Kalsia. Himachal Pradesh was created as a union territory from several princely states and Kangra District. In 1956, PEPSU was merged into Punjab state, and several northern districts of Punjab in the Himalayas were added to Himachal Pradesh. The capital of the undivided Punjab province, Lahore, ended up in Pakistan after partition, so a new capital for Indian Punjab state was built at Chandigarh. On November 1, 1966, the mostly Hindu southeastern half of Punjab became a separate state, Haryana. Chandigarh was on the border between the two states, and became a separate union territory which serves as the capital of both Punjab and Haryana.