Anandpur Sahib was founded in 1665 by the ninth Sikh Guru, Guru Tegh Bahadur. The Guru purchased a tract of land near the ruins of the ancient village of Makhowal from the ruler of Bilaspur. Initially named Chakk Nanaki after the Guru's mother, the settlement served as a peaceful refuge for the Sikh community in the lower Shivalik hills.
The city reached the zenith of its historical and martial importance under the leadership of Guru Gobind Singh, the tenth Sikh Guru. He spent more than 25 years in the city, heavily fortifying it with a ring of forts—Anandgarh, Keshgarh, Lohgarh, Holgarh, Fatehgarh, and Taragarh—to protect the community from the Mughal Empire and antagonistic Rajput hill chiefs. On the day of Vaisakhi in 1699, Guru Gobind Singh gathered thousands of followers at Keshgarh and initiated the "Panj Pyare" (the Five Beloved Ones), formally establishing the Khalsa. This transformative event reshaped the Sikh community into a structured, martial, and fiercely egalitarian faith.
During the early 18th century, Anandpur Sahib was the site of several fierce sieges and battles, most notably the Battles of Anandpur in 1700 and 1704. Following a prolonged siege by allied Mughal and hill state forces, Guru Gobind Singh and his followers were forced to evacuate the city in 1704, leading to heavy casualties and a period of desolation for the area.
In the centuries that followed, the city was gradually reclaimed and rebuilt by Sikh devotees. Throughout the 20th century, particularly after the Partition of India in 1947, Anandpur Sahib saw significant infrastructural and cultural investment. In 1999, to mark the tercentenary of the Khalsa's founding, the state and central governments undertook a massive beautification project, painting the city white and commencing the construction of the acclaimed Virasat-e-Khalsa heritage complex, which opened to the public in 2011.
