He was executed by the emperor Jahandar Shah after refusing the offer of a pardon if he converted to Islam.[284] The decline of Mughal power during the 17th and 18th centuries, along with the growing strength of the Sikh Empire, resulted in a balance of power which protected the Sikhs from more violence. The Sikh empire was absorbed into the British Indian empire after the Second Anglo-Sikh War of 1849.