The Battle of Anandpur was fought between the armies of the Sikh Guru Gobind Singh and the Mughal forces aided by the Nawab of Bahawalpur state and Rajas of the Sivalik Hills. The increasing power of Guru Gobind Singh Ji, and his establishment of Khalsa alarmed the Rajas of the Sivalik hills. After some failed attempts to check the Guru’s power, the Rajas pleaded the Mughals and Emperor Aurangzeb to help them against the Guru.
The Mughal viceroy of Delhi sent his generals Din Beg and Painda Khan, each with an army of five thousand men, to subdue the Guru.
The Mughal forces were joined by the armies of the hill chiefs at Rupar. The Guru appointed the Panj Piare, his five beloved Sikhs, as the generals of his army. Painda Khan was killed in combat by Guru Gobind Singh. After Painde Khan’s death, Din Beg assumed the command of his troops, however, he failed to overpower the Guru’s forces. The hill Rajas fled from the battlefield, and Din Beg was forced to retreat after being wounded.