Ali Gohar was born to
Shahzada (Prince)
Aziz-ud-Din, son of the deposed Mughal Emperor
Jahandar Shah, on 25 June 1728. Alongside his father, he grew up in semi-captivity in the Salatin quarters of the
Red Fort. However, unlike the majority of Mughal princes growing up in similar circumstances, he is not recorded to have become a decadent prince by the time his father became emperor, and therefore was naturally given high appointments in the course of his father's reign. Upon his father's accession, he became the
Wali al-Ahd (
Crown Prince) of the empire, and became his father's principal agent, though almost all power lay in the Wazir
Imad-ul-Mulk's hand. His quarrels with that amir, and fear for his own life, caused him to flee from Delhi in 1758.
Escape from Delhi Prince Ali Gauhar, afterwards Emperor Shah Alam II, had been the heir apparent of his father
Alamgir II. Prince Ali Gauhar's father had been appointed Mughal Emperor by Vizier Imad-ul-Mulk and Maratha
Peshwa's cousin
Sadashivrao Bhau. Prince Ali Gauhar organized a militia and made a daring escape from Delhi. He appeared in the Eastern Subah in 1759, hoping to strengthen his position by attempting to regain control over
Bengal,
Bihar and
Odisha. Very soon however,
Najib-ud-Daula forced the usurper Imad-ul-Mulk to flee from the capital by gathering a large
Mughal Army outside Delhi. He used the army to depose the recreant
Shah Jahan III. Najib-ud-Daula and Muslim nobles then planned to defeat the Marathas by maintaining correspondence with the powerful
Ahmad Shah Durrani. After Durrani decisively defeated the Marathas, he nominated Ali Gauhar as the emperor under the name Shah Alam II.
Bengal War In 1760, after Shah Alam's militia gained control over pockets in Bengal, Bihar and parts of Odisha, Prince Ali Gauhar and his Mughal Army of 30,000 intended to overthrow
Mir Jafar and Imad-ul-Mulk as they tried to capture or kill him by advancing towards
Awadh and
Patna in 1759. But the conflict soon involved the intervention of the assertive
East India Company. The Mughals clearly intended to recapture their breakaway Eastern Subah led by Prince Ali Gauhar, who was accompanied by a
Militia consisting of persons like Muhammad Quli Khan, Kadim Husein, Kamgar Khan, Hidayat Ali, Mir Afzal and Ghulam Husain Tabatabai. Their forces were reinforced by the forces of
Shuja-ud-Daula, Najib-ud-Daula and
Ahmad Khan Bangash. The Mughals were also joined by
Jean Law and 200 Frenchmen and waged a campaign against the British during the
Seven Years' War. Prince Ali Gauhar successfully advanced as far as Patna, which he later besieged with a combined army of over 40,000 in order to capture or kill Ramnarian, a sworn enemy of the Mughals. Mir Jafar was in terror at the near demise of his cohort and sent his own son Miran to relieve Ramnarian and retake Patna. Mir Jafar also implored the aid of
Robert Clive, but it was Major
John Caillaud, who dispersed Prince Ali Gauhar's army in 1761 after four major battles including Battle of Patna, Battle of Sirpur, Battle of Birpur and Battle of Siwan. After negotiations assuring peace Shah Alam II was escorted by the British to meet
Mir Qasim the new
Nawab of Bengal, who was nominated after the sudden death of Miran. Mir Qasim soon had the Mughal Emperor's investiture as
Subedar of Bengal, Bihar and Odisha, and agreed to pay an annual revenue of 2.4 million
dam. Shah Alam II then retreated to
Allahabad and was protected by the Shuja-ud-Daula, the
Nawab of Awadh from 1761 until 1764. Meanwhile, Mir Qasim's relations with the East India company began to worsen. He initiated reforms that withdrew the tax exemptions enjoyed by the East India Company, he also ousted Ramnarian and created
firelock manufacturing factories at Patna with the sole purpose of improving the newly reformed Mughal Army. Angered by these developments, the East India Company sought to oust Mir Qasim. Court intrigues encouraged by the East India Company forced Mir Qasim to leave Bengal, Bihar and Odisha. Mir Qasim on his part encouraged Shuja-ud-Daula the Nawab of Awadh and Shah Alam II to engage the British. File:Ghází al-Dín Xán ʿImád al-Mulk.jpg|
Imad-ul-Mulk was the regent imposed by the
Maratha Confederacy in 1757, who assassinated
Alamgir II and prominent members of the imperial family, within the Maratha controlled city of
Delhi; Shah Alam II managed to escape to safety with the
Nawab of Awadh. File:Mir Jafar and his son Miran delivering the Treaty of 1757 to William Watts.jpg|
Mir Jafar, his son Miran and Ramnarian refused to submit to Shah Alam II, who initiated the
Bengal War causing the eventual intervention of the
East India Company. == Emperor from Allahabad ==