Shaista Khan had even occupied Pune . Shivaji had already lost Chakan Kalian and the Maratha commander Netaji Palker was worsted in a sanguary fight and he had to escape losing much of the booty being brought from the Mughal territory. During these three years 1660 to 1663 Shivaji had lost practically all the 'Swarajya' which he had won with great effort during the past many years and this was despite his many victories, such as at Umbar Khind , Mira Dongar , capture of Rajapur. He was completely non-plussed as what to do with Shaista Khan sitting pretty in Pune. At last he decided to extricate himself from this situation by some daring act to be executed by himself personally, as he had done about four years ago in case of Afzal Khan.
Within a month of the defeat of the Maratha army under Netaji Palkar, Shivaji dealt a masterly blow at the Mughals. Midnight of 5 april 1663 Shivaji with 400 Mavles entered the Mughal camp through the main gate saying that they were a party of the Deccani soldiers of the Mughal army going in to relieve those who were already on duty. It was the month of Ramzan. The Khan and his household after breaking their day's fast, had retired to their beds before midnight. As the moon set, the camp and the Lal Mahal, were enveloped in darkness, with a few dim lights showing how the people were stationed at different points. Shivaji with 50 men quietly entered the palace through a hole made in the weak kitchen wall behind. They then rushed towards the bed-chamber, cutting the cloth partitions, striking people in their beds, some of the Maratha soldiers are shown entering the palace at Pune through a hole made in the kitchen wall, some have reached the stair case and they are beckoning others to follow, while Shivaji has already reached the sleeping chamber of Shaista Khan and is about to strike him. The Khan, however, managed to leap but he losing his forefingers. They making a loud clamour which only added to the confusion. Amidst shrieks, shouts and confusion all around, Shivaji and his party left the scene and escaped to Sinhagad from where they had come. Later, it was discovered that though Shaista Khan had managed to save his life, his fore fingers were cut off by the blow of Shivaji's sword when he was jumping out of the window.
This unbelievably successful attack on the Mughal Governor of the Deccan in the most protected area of the Mughal camp, surrounded by thousands of troops, immensely enhanced the reputation of Shivaji's daring, while causing bitter humiliation at the Mughal court, but the most evident and fruitful result of this daring raid was the retreat of Shaista Khan to Burhanpur for safety and his subsequent transfer to Bengal. At one stroke Shivaji had nullified all the gains of the Mughals achieved in 3 year.