According to historical records, Anupshahr was founded by Bargujar Raja Anup Rai between 1605 and 1628. The date of foundation coincides with the reign of the Mughal Emperor Jahangir. There is a legend that Anup Rai saved the life of the emperor from a lion during a hunting expedition. Jahangir then donated the area to Anup Rai, and he established the town and also a fort in the region. Anupshahr flourished during the reign of King Tarasingh, the eighth generation of Raja Anup Rai and became an important centre for Ayurvedic medicine.
Later, during the first war of Independence, Anupshahr was the scene of several uprisings. The town is also known as Choti Kashi because it is located on the banks of the River Ganga and has several temples and guest houses that are designed in a way similar to Kashi.