The origins of this battle were laid a little over six months before, when Shivaji killed Afzal Khan at Pratapgad on the 10th of November in 1659. This was then followed by a very short battle a month later between Shivaji and Rustom-e-Jaman at Kolhapur on December 28, 1659. Shivaji, after this victory took over Panhala from Ali Adil Shah II, the fifth king of the Adil Shahi sultanate of Bijapur (Bijapur was one of the five Deccan sultanates including Ahmednagar, Bidar, Berar, and Golconda). Shivaji then continued spreading his influence over the region. This obviously caused distress to Ali Adil Shah II who was all set to march to Panhala. However, Siddi Johar who had defied the Shah and taken over the jagir Kurnool, offered a deal to Ali Adil Shah II to recognise his control over Kurnool in return for laying the siege at Panhala. The Shah agreed, and gave him the title of Salabat Jung. Siddi Johar was assisted by Siddi Masud and Fazal Khan (Afzal Khan’s son). The siege was laid on March 2, 1660 with a force of fifteen thousand men.
The siege continued for six months into the month of July in 1660. The Adilshahi army cut of all supplies to the fort and made it increasingly difficult for Shivaji to continue resisting the siege. Sensing the trap, Shivaji clandestinely communicated with Siddi Johar and requested an alliance with him and a safe passage. Siddi, saw this as an opportunity to carve out a separate empire of his own with Shivaji and agreed to meet him. They met at midnight and agreed to cooperate. Shivaji returned to the fort and the siege continued as before.
Fazal Khan, however, was adamant on taking revenge for the death of his father, Afzal Khan, at Pratapgad. He maintained a close watch on the movements of Shivaji and continued the siege in all seriousness. However, Panhala is one of the largest forts in the Sahydri Mountain Range. Fifteen thousand men were too less to take on a fort of that size. Fazal Khan, instead, chose to attack Pavangad, a nearby fort and avoided a frontal attack. He used British guns and began shelling Pavangad. The commander of Pavangad requested for relief from Panhala. Shivaji know knew that if Pavangad fell, supplies to Panhala would be cut and would be starved.
Two teams left Panhala on the night of July 13, 1660. Shivaji and his commanders took a side road to Vishalgad, about 70 kilometres away from Panhala, while Shiva Kashid, a barber who had a strong resemblance to Shivaji, led the other team on the main road to Vishalgad, impersonating Shivaji. When news reached Fazal Khan’s camp, they captured the second team and brought them back to base. The imposter was however recognised and beheaded and Fazal Khan chased Shivaji through the night to Vishalgad.
As they were nearing Vishalgad, at Gajapur, 12 kilometres away from their destination, Baji Praphu Deshpande, one of Shivaji’s commander stayed back at a narrow pass named Ghodkhind with seven hundred other Maratha warriors. This is a classic rear-guard defence tactic, during an escape. Interestingly a similar situation was faced by the Greeks against the Persians in the Battle of Thermopylae
Baji Prabhu’s instructions were to hold guard till he heard cannons fired from Vishalgad, which would signal the safe passage of Shivaji into Vishalgad. Baji Prabhu fought valiantly in that pass for five hours, supposedly with two swords weighing 15 kilograms each. (Shivaji later renamed that pass as Paavan Khind (Sacred Pass) in the memory of Baji Praphu Deshpande). The remaining soldiers carried his wounded body into the hills and left the pass open.
The chasing army pushed on to Vishalgad, however chose not to attack in that terrible region (If you have been there, you will know what it means.); they returned to Panhala, and eventually to Bijapur. Johar’s treason was now known to Ali Adil Shah II and he moved to Miraj to ‘punish’ him. Johar saw his position and finally made the Marathas give up Panhala on September 22, 1660 and handed over the fort to Adil Shah II. (January 1661, according to Grant Duff)