According to the (Bareilly History) epic Mahābhārata, the Bareilly region (Panchala) is said to be the birthplace of Draupadi, who was also referred to as ‘Panchali’ (one from the kingdom of Panchāla) by Kṛṣṇā (Lord Krishna). When Yudhishthira becomes the king of Hastinapur at the end of the Mahābhārata, Draupadi becomes his queen. The folklore says that Gautama Buddha had once visited the ancient fortress city of Ahichchhatra in Bareilly. The Jain Tirthankara Parshva is said to have attained Kaivalya at Ahichchhatra. In a Historic book (Sikar Ka Itihaas) written by Pt. Jhabarmall Sharma It is believed that the descendants of Lord Shriram’s son Kusha went from Ayodhya to Rohtas, Narwar, Gwalior and Bareilly respectively their capital. In the 21st generation, Maharaja Nala, Soddevji made Gopachal (Gwalior) the capital. The time of going to Gwalior to Bareilly looks like Vikrama 933. In the 12th century, the kingdom was under the rule by different clans of Kshatriya Rajputs. Then the region became part of the Muslim Turkic Delhi Sultanate for 325 years before getting absorbed in the emerging Mughal Empire. The foundation of the modern City of Bareilly foundation was laid by Mughal governor Mukrand Rai in 1657 during the rule of Mughal Emperor Aurangzeb. Later the region became the capital of Rohilkhand region before getting handed over to Nawab Vazir of Awadh and then to East India Company (transferred to the British India) and later becoming an integral part of India. The region has, also, acted as a mint for a major part of its history.
From archaeological point of view the district of Bareilly is very rich. The extensive remains of Ahichchhatra, the Capital town of Northern Panchala have been discovered near Ramnagar village of Aonla Tehsil in the district. It was during the first excavations at Ahichchhatra (1940–44) that the painted grey ware, associated with the advent of the Aryans in the Ganges–Yamuna Valley, was recognised for the first time in the earliest levels of the site. Nearly five thousand coins belonging to periods earlier than that of Guptas have been yielded from Ahichchhatra. It has also been one of the richest sites in India from the point of view of the total yield of terracotta. Some of the masterpieces of Indian terracotta art are from Ahichchhatra. In fact the classification made of the terracotta human figurines from Ahichchhatra on grounds of style and to some extent stratigraphy became a model for determining the stratigraphy of subsequent excavations at other sites in the Ganges Valley. On the basis of the existing material, the archaeology of the region helps us to get an idea of the cultural sequence from the beginning of the 2nd millennium BC up to the 11th century AD. Some ancient mounds in the district have also been discovered by the Deptt. of Ancient History and culture, Rohilkhand University, at Tihar-Khera (Fatehganj West), Pachaumi, Rahtuia, Kadarganj and Sainthal. Apart from this, artefacts of painted grey ware culture of the Iron Age have also been discovered near the city.