Answer
Shah Alam II is considered the rightful emperor but could not return to Delhi until 1772. He was forced to flee the city by the Marathas in 1757 and spent the next 15 years in exile in Allahabad. In 1772, the British East India Company defeated the Marathas at the Battle of Buxar and restored Shah Alam II to the throne of Delhi.