In 1701, a combined army composed of the Sivalik Hill Rajas and the Mughal army under Wazir Khan attacked Anandpur and, following a retreat by the Khalsa, was defeated by the Khalsa at the Battle of Muktsar. Banda Singh Bahadur was an ascetic who converted to Sikhism after meeting Guru Gobind Singh at Nanded. Shortly before his death, Guru Gobind Singh ordered him to uproot Mughal rule in Punjab and gave him a letter that commanded all Sikhs to join him.