Shah Alam II, born Ali Gohar on June 25, 1728, was the 17th Mughal emperor and a poet. He was the son of Alamgir II and spent his early years with his father in semi-captivity at Delhi’s Red Fort. After becoming crown prince, he fled Delhi in 1758 amid conflict with the powerful minister Imad-ul-Mulk.
His path to the throne unfolded amid invasions and shifting alliances. Ahmad Shah Abdali recognized him as emperor after defeating the Marathas in 1761, but Shah Alam remained unable to return to Delhi for years. He joined Mir Qasim and Shuja-ud-Daula against the East India Company, whose victory at the Battle of Buxar in 1764 compelled him to sign the Treaty of Allahabad. Under its terms, he granted the Company revenue-collection rights in Bengal, Bihar, and Odisha in exchange for an annual payment. He lived at Allahabad until 1772, when Mahadaji Scindia escorted him back to Delhi.
Shah Alam’s authority remained limited. The Mughal army briefly strengthened under the command of Mirza Najaf Khan, but after Najaf Khan’s death in 1782 imperial power declined further. In 1788, while held captive by Ghulam Qadir, Shah Alam was blinded. The British captured Delhi in 1803, leaving him a pensioner. He died on November 19, 1806.
Alongside his political life, Shah Alam wrote poetry under the pen name Aftab. Mirza Fakhir Makin guided, compiled, and collected his poems into a Diwan. Shah Alam also composed Ajaib-ul-Qasas, a notable early work of Urdu prose.