Shah Jahan, anxious to annex Bijapur to his empire, found a pretext in the legitimacy of Ali's parents. On
Aurangzeb’s plea,
Shah Jahan sanctioned the invasion of Bijapur and gave him a free hand to deal with the situation. This sanction of such a war was wholly unrighteous. Bijapur was not a vassal state of the
Mughals, but an independent and equal ally of the Mughal Emperor, and the latter had no lawful right to confirm or question the succession to the
Bijapur Sultanate. However, Aurangzeb had to raise the siege and rush north for the war of succession to the Mughal throne. With Muhammad's death and Ali's accession, disorder had begun in the
Karnataka. The
Nayaks tried to recover their former lands. (
Bangalore, the capital of
Karnataka, was Bijapur's administrative headquarters for controlling these feudatories by Kempegouda.) Meanwhile,
Shivaji increased the momentum of acquiring more and more Bijapur territory and carved an independent
Maratha state, while his diplomacy prevented any
Mughal-
Bijapur coalition against him. At the court, things were even worse. With the coming of a young and weak ruler, the party factions and struggle for supremacy was at its zenith. To aggravate them,
Aurangzeb intrigued with Bijapur nobles and succeeded in winning over most of them. Throughout his reign of 16 years, Ali struggled desperately both against the
Mughals and the
Marathas. He thrice repulsed Mughal invasions. But when he died in 1672, the Bijapur kingdom was deprived of most of its important territorial possessions. With the expansion of
Shivaji’s kingdom, there was a corresponding shrinkage in the Bijapur territory. ==Literary activity==