Following his shocking defeat of Afzal Khan and the rout of the Bijapuri army at Pratapgad, Shivaji continued to push deep into Bijapuri territory. Within a few days, the Marathas captured Panhala (near the city of Kolhapur). Meanwhile another Marathi force, led by Netaji Palkar, pushed straight on towards Bijapur. Bijapur repulsed this attack, however, and Shivaji and a few of his sardars retreated to Panhala.
The Bijapuri force was led by Siddhi Johar, an Abyssinian general. Discovering Shivaji's location, Johar laid siege to Panhala. Netaji Palkar made repeated attempts to break the Bijapuri siege from outside, but these failed.
Finally a very audacious and risky plan was decided: Shivaji, Baji Prabhu Deshpande and with a select band of troops would attempt to break through the siege at the night, and make for Vishalgadh. In order to deceive the Bijapuri forces, who would give a chase once they found that Shivaji had broken the siege, Shiva Nhavi, who had an uncanny physical resemblance to Shivaji, volunteered to dress like the king and let himself be captured.
On a stormy new moon's night a band of 300 hundred select men, led by Baji Prabhu and Shivaji, broke through the siege. They were hotly pursued by the Bijapuri force. As planned, Shiva Nhavi allowed himself to be captured and taken back to the Bijapuri camp, fully comprehending that he would be put to death once the charade was discovered. This sacrifice, however gave the fleeing Maratha force some breathing space.
As soon as the Bijapuri force realized their mistake, the chase was on again, led by Siddhi Masood, the son-in-law of Siddhi Johar. Near the pass of Ghodkhind (Horse's Pass), the Marathas made a final stand. Shivaji and half of the Maratha force pushed for Vishalgadh, while Bajiprabhu and the remaining Badal Sena of about 150 men blocked the pass.
Tradition and legend describe feats of valour displayed by the Marathas during this rear guard action. Through the entire battle, Bajiparbhu, even though grievously injured, continued fighting, inspiring his men to fight on until Shivaji's safe journey to Vishalgadh was signaled by the firing of three cannon volleys.
The Khind (Pass) was subsequently named Pavan Khind (Holy Pass) by Shivaji, in honor of the sacrifice of Baji Prabhu and his troops. Shivaji also gave "manache pahile pan" ("Honor of the Court") to Baji Prabhu's family.