After every Imperial commander had failed to check Shivaji’s rapidly growing power, Mirza Raja Jai Singh of Amber, was sent by Aurangzeb to deal with the Maratha hero. Mirza Raja, certainly the ablest military commander and diplomat of his time, conducted the campaign against Shivaji with great success. He reached Pune and a few days later commenced the siege of Purandar fort. After a few months Shivaji thought it prudent to have peace, at least for the time being and concluded the Treaty of Purandar. By this Treaty Shivaji had to surrender two-third of his important forts. It was natural for Shivaji to feel great hesitation in agreeing to visit Agra to meet the Emperor for which Mirza Raja Jai Singh was insisting so much and was urging the Emperor with equal force to receive a visit from the Maratha hero. Jai Singh and his eldest son, Kunwar Ram Singh, stood guarantee for Shivaji’s life and safety. The visit, though not without hazards in view of Aurangzeb’s known character and dubious record, offered Shivaji an opportunity to get a ‘realistic’ idea of the power of the Mughal Empire and held forth other opportunities as well, making it worth a trial.
After making as perfect arrangements as possible for his work being carried in his absence, Shivaji set out from Raigad on 5 March 1666, with his son Shambhaji, and a select following of officials and servants and an escort of about 4000 men, for Agra. His arrival in Agra was to coincide with the 50th lunar birthday of Aurangzeb on which occasion a grand darbar was to be held on 12th May 1666. When presented before the Emperor Aurangzeb, the emperor did not exchange a word with Shivaji who was conducted to stand in the line of the mansabdars of 5000 rank. When Khilats were presented to Maharaja Jaswant Singh of Jodhpur and two or three other nobles of high rank, Shivaji was ignored. Shivaji angrily left the Court, loudly exclaiming words of displeasure at being slighted, and refused to see the Emperor again, or accept a mansab or a khilat. Shivaji remained in Agra till 18th August in virtual confinement till he managed to regain his freedom outwitting the most wily Emperor ever to occupy the Mughal throne.