The denizens of heaven were very much pleased, and they offered their respects by chanting in glorification of the Lord and showering Him with flowers, accepting the victory with great appreciation. Jarāsandha returned to his kingdom, and Mathurā City was saved from the danger of imminent attack. The citizens of Mathurā organized the combined services of professional singers like sūtas and māgadhas, along with poets who could compose nice songs, and they began to chant the victory glorification of Lord Kṛṣṇa. When Lord Kṛṣṇa entered the city after the victory, many bugles, conches and kettledrums sounded, and the vibrations of various musical instruments like bherīs, tūryas, vīṇās, flutes and mṛdaṅgas all joined together to make a beautiful reception. While Kṛṣṇa was entering, the whole city was cleansed, all the different streets and roads were sprinkled with water, and the inhabitants, being joyous, decorated their respective houses and shops with flags and festoons. The brāhmaṇas chanted Vedic mantras at numerous places. The people constructed road crossings and gates at entrances to lanes and streets. When Lord Kṛṣṇa was entering the nicely decorated city of Mathurā in a festive attitude, the ladies and girls of Mathurā prepared different kinds of flower garlands to make the ceremony most auspicious. In accordance with the Vedic custom, they took yogurt mixed with fresh green grass and strewed it here and there to make the victory jubilation even more auspicious. As Kṛṣṇa passed through the street, all the ladies and women regarded Him with eyes bright with great affection. Kṛṣṇa and Balarāma carried various kinds of ornaments, jewels and other booty carefully collected from the battlefield and presented it all to King Ugrasena. Kṛṣṇa thus offered His respect to His grandfather because Ugrasena was at that time the crowned king of the Yadu dynasty.
Jarāsandha, the King of Magadha, besieged the city of Mathurā not only once but seventeen times in the same way, equipped with the same number of military phalanxes. Each and every time, he was defeated and all his soldiers were killed by Kṛṣṇa, and each time he had to return home disappointed. Each time, the princely order of the Yadu dynasty arrested Jarāsandha in the same way and again released him in an insulting manner, and each time Jarāsandha shamelessly returned home.
While Jarāsandha was attempting his eighteenth attack, a Yavana king somewhere to the south of Mathurā became attracted by the opulence of the Yadu dynasty and also attacked the city. It is said that the King of the Yavanas, known as Kālayavana, was induced to attack by Nārada. This story is narrated in the Viṣṇu Purāṇa. Once, Garga Muni, the priest of the Yadu dynasty, was taunted by his brother-in-law. When the kings of the Yadu dynasty heard the taunt they laughed at him, and Garga Muni became angry at the Yadu kings. He decided that he would produce someone who would be very fearful to the Yadu dynasty, so he pleased Lord Śiva and received from him the benediction of a son. He begot this son, Kālayavana, in the wife of a Yavana king. This Kālayavana inquired from Nārada, “Who are the most powerful kings in the world?” Nārada informed him that the Yadus were the most powerful. Thus informed, Kālayavana attacked the city of Mathurā at the same time that Jarāsandha tried to attack it for the eighteenth time. Kālayavana was very eager to declare war on a king of the world who would be a suitable combatant for him, but he had not found any. However, being informed about Mathurā by Nārada, he thought it wise to attack this city with thirty million Yavana soldiers.
When Mathurā was thus besieged, Lord Śrī Kṛṣṇa began to consider, in consultation with Baladeva, how much the Yadu dynasty was in distress, being threatened by the attacks of two formidable enemies, Jarāsandha and Kālayavana. Time was growing short. Kālayavana was already besieging Mathurā from all sides, and it was expected that the day after next, Jarāsandha would also come, equipped with the same number of divisions of soldiers as in his previous seventeen attempts. Kṛṣṇa was certain that Jarāsandha would take advantage of the opportunity to capture Mathurā when it was also being besieged by Kālayavana. He therefore thought it wise to take precautionary measures for defending against an attack upon Mathurā from two strategic points. If both Kṛṣṇa and Balarāma were engaged in fighting with Kālayavana at one place, Jarāsandha might come at another to attack the whole Yadu family and take his revenge. Jarāsandha was very powerful, and having been defeated seventeen times, he might vengefully kill the members of the Yadu family or arrest them and take them to his kingdom. Kṛṣṇa therefore decided to construct a formidable fort where no two-legged animal, either man or demon, could enter. He decided to keep His relatives there so that He would then be free to fight the enemy. It appears that formerly Dvārakā was also part of the kingdom of Mathurā. In Śrīmad-Bhāgavatam it is stated that Kṛṣṇa constructed the fort in the midst of the sea. Remnants of the fort Kṛṣṇa constructed still exist in the Bay of Dvārakā.