After every Imperial commander had failed to check Shivaji Maharaj’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 Maharaj thought it prudent to have peace, at least for the time being and concluded the Treaty of Purandar. By this Treaty Shivaji Maharaj had to surrender two-third of his important forts. It was natural for Shivaji Maharaj 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 Maharaj’s life and safety. The visit, though not without hazards in view of Aurangzeb’s known character and dubious record, offered Shivaji Maharaj 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 Maharaj 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 Maharaj 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 Maharaj was ignored. Shivaji Maharaj 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 Maharaj 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.