The history of Peshawar is intertwined with the history of the broader Indian subcontinent. The region was known as Puruṣapura in Sanskrit, literally meaning "city of men". Being among the most ancient cities of the Indian subcontinent, Peshawar has for centuries been a center of trade between West Asia, Central Asia, and the Indian subcontinent.
Ancient history
In recorded history, the earliest major city established in the general area of Peshawar was called Puruṣapura (Sanskrit for City of Men), from which the current name "Peshawar" is likely derived and was western capital of Gandhara, after Pushkalavati. By the 2nd century BCE, Peshawar was an ancient center of learning, as witnessed by the Bakhshali Manuscript, which used the Bakhshali approximation ans was found nearby. The region was annexed by the Persian Achaemenid Empire. Later, the city was invaded by Alexander the Great's army. The city passed into the rule of Alexander's successor, Seleucus I Nicator who ceded it to Chandragupta Maurya, the founder of the Maurya Empire. The fall of the Mauryans provided opportunity to the Indo-Greeks to establish their rule over the region. The Indo-Greek kings combined the Greek and Indian languages and symbols, as seen on their coins, and blended ancient Greek, Hindu and Buddhist religious practices, as seen in the archaeological remains of their cities and in the indications of their support of Buddhism, pointing to a rich fusion of Indian and Hellenistic influences. The diffusion of Indo-Greek culture had consequences which are still felt today, particularly through the influence of Greco-Buddhist art. The Indo-Greeks ultimately disappeared at Peshawar as a political entity around 10 CE following the invasions of the Indo-Scythians, although pockets of Greek populations probably remained for several centuries longer under the subsequent rule of the Indo-Parthians and Kushans.

The city was then conquered by the Kushan Empire. The Kushan Emperor Kanishka, who ruled from 127 CE, moved the capital from Pushkalavati (present-day Charsadda district, in the Peshawar Valley) to Gandhara (Peshawar city) in the 2nd century CE. Buddhist missionaries arrived at Vedic, and animist Peshawar, seeking counsel with the Kushan rulers. Their teachings were embraced by the Kushans, who converted to Buddhism, assigning the religion with great status in the city. Following this move by the Kushans, Peshawar became a center of Buddhist learning.

The giant Kanishka stupa at Peshawar, which may have been the tallest building in the world at the time, was built by King Kanishka to house Buddhist relics just outside the present-day Ganj Gate of the old city of Peshawar. The Kanishka stupa was said to be an imposing structure, as one traveled down from the Hindu Kush mountains onto the Gandharan plains. The earliest account of the famous building was documented by Faxian, the Chinese Buddhist pilgrim, who was also a monk, who visited the structure in 400 AD and described it as being over 40 chang in height (approximately ) and adorned "with all precious substances". Faxian continued: "Of all the stûpas and temples seen by the travelers, none can compare with this for beauty of form and strength." The stupa was eventually destroyed by lightning, but was repaired several times; it was still in existence at the time of Xuanzang's visit in 634 AD. A jeweled casket containing relics of the Gautama Buddha, and an inscription identifying Kanishka as the donor, existed at the ruined base of this giant stupa — the casket was excavated, by a team supervised by Dr D.B. Spooner in 1909, from a chamber under the very centre of the stupa's base.

Medieval history
The Buddhist, Hindu, and Zoroastrian Pashtuns began converting to Islam following the early annexation by the Arab Empire from Khurasan (in what is Afghanistan, Turkmenistan and northeastern Iran). The Kabul Shahis ruled the Kabul Valley and Gandhara (modern-day Pakistan and Afghanistan) from the decline of the Kushan Empire in the 3rd century to the early 9th century CE. The Shahis are generally split up into two eras: the Buddhist Shahis and the Hindu Shahis, with the change-over thought to have occurred sometime around 870 CE. The kingdom was known as the Kabul Shahan or Ratbelshahan from 565 CE to 670 CE, when the capitals were located in Kapisa and Kabul, and later Udabhandapura, also known as Hund, for its new capital.





