Jarasandha had led seventeen campaigns against the Yadavs, in particular against Krishna and Balarama.
His express aim was to avenge the death of Kamsa. The Lord of the Magadha was defeated in each of these battles. And now he was again before the defences of Mathura for his eighteenth campaign against Yadu power. His strength was so great and the defences of Mathura were in such a poor state, the morale of the Yadavs so low that elders like Vikadru advised Krishna, the chief cause of the conflict, not to risk a fight as it would bring certain ruin upon Mathura. Following the dictum discretion is the best part of
valour’ Krishna and Balarama left the city and proceeded towards the Sahyadris; particularly towards Karvir, a city which their ancestors had founded.

On receiving in intelligence of their flight, Jarasandha followed in pursuit. Near the outskirts of the city the pair met the ancient sage Parashurama. He advised them not to seek refuge in Karvir as it was under a cruel and ferocious monarch by name of Shrill. He asked them to accompany him to the Gomantak mountain and from there to launch a vigorous hill-warfare, 'giri-yuddha’ against the onrushing hordes of Jarasandha. The two Yadavs accordingly went to Gomantak and routed the Magadha troops completely, Chhedi Raj, a distant relative of theirs, led them to Karvirnagar again after the struggle was over and here they killed Shrigal and enthroned his son Shakradeva on the throne. This story, although it tells as to how the city was established gives no account of how it came to be named Karvir or Kolhapur. That the Karvir- mahatmya does.