 Complete the following phrase:  The Mughal Emperor Shah Alam II 17591806 made futile attempts to reverse the Mughal decline but ultimately had to seek the protection of the Emir of Afghanistan, Ahmed Shah Abdali, which led to the Third Battle of Panipat between the Maratha Empire and the Afghans led by Abdali in 1761. In 1771, the Marathas recaptured Delhi from Afghan control and in 1784 they officially became the protectors of the emperor in Delhi, a state of affairs that continued until the Second Anglo-Maratha War. Thereafter, the British East India Company became the protectors of the Mughal dynasty in Delhi. The British East India Company took control of the former Mughal province of Bengal-Bihar in 1793 after it abolished local rule Nizamat that lasted until 1858, marking the beginning of British colonial era over the Indian Subcontinent. By 1857 a considerable part of former Mughal India was under the East India Companys control. After a crushing defeat in the 