Aurangzeb ruled the Mughal Empire for nearly forty-nine years and died in 1707. At the time of his death, he had three surviving sons—Azam Shah, Kam Bakhsh, and Muazzam. Muazzam was serving as the governor of Kabul, Azam Shah was the governor of Gujarat, and Kam Bakhsh governed Bijapur.

Aurangzeb himself had ascended the throne after a brutal war of succession against his brothers. Perhaps wishing to avoid a similar conflict, he reportedly expressed the desire that his sons should divide the empire among themselves. However, none of them respected this wish, and a struggle for the throne began immediately after his death.
Both Azam Shah and Muazzam proclaimed themselves emperor and marched towards Agra to secure control of the empire. Their armies confronted each other in the Battle of Jajau. In the fierce battle that followed, Azam Shah and his son Bidar Bakht fought bravely but were killed on the battlefield. The surviving sons of Azam Shah were captured and later kept under house arrest, though they were granted pensions.
Meanwhile, Kam Bakhsh refused to recognize Muazzam’s authority and proclaimed himself an independent ruler in the Deccan. Some nobles advised him to submit to Muazzam, but Kam Bakhsh reportedly executed those who offered such counsel. Muazzam, who had now assumed the imperial title of Bahadur Shah I, marched towards the Deccan to confront his younger brother. The march took several months, during which Bahadur Shah succeeded in winning the support of several nobles who had previously sided with Kam Bakhsh.
In the ensuing conflict, Kam Bakhsh was severely wounded and captured. He was brought before Bahadur Shah, who ordered that he be given medical treatment. However, Kam Bakhsh died the following day from his injuries. His sons were captured but were not executed; instead, they were kept under house arrest and provided with adequate pensions.
Although Bahadur Shah had to engage in a war of succession to secure the Mughal throne, he was considered less ruthless than his predecessors such as Shah Jahan and Aurangzeb. While his brothers died during the conflict, he chose to spare the lives of their sons and ensured their maintenance through royal pensions.

