Shivaji was a son of the Bijapur's general Shahaji, who had fought alongside Afzal Khan. He administered Shahaji's fiefs in the Pune region, and had started acting independently of the Bijapur government. He had captured territories ruled by other subordinates of Bijapur, and had negotiated with the Mughal emperor Aurangzeb, who had invaded the Bijapur Sultanate. Shivaji claimed to be a loyal servant of Bijapur, but the Bijapur government doubted his loyalty. During much of the 1650s, the Bijapur government had been unable to take any steps against Shivaji because it was busy dealing with the Mughal invasion, internal factional politics, and a succession dispute. After a peace treaty with the Mughals, and the general acceptance of Ali Adil Shah II as the king, the Bijapur government became more stable, and turned its attention towards Shivaji.