Hindu tradition holds that Krishna was born in a prison cell in Mathura, where his uncle, the tyrant king Kamsa, had imprisoned his parents Vasudeva and Devaki after a prophecy foretold that Devaki's eighth child would kill him; Krishna was smuggled out across the Yamuna to Gokul the night of his birth and raised there and in nearby Vrindavan among cowherds before returning as an adult to kill Kamsa and restore rightful rule. That story places Mathura among the Sapta Puri, the seven cities Hindu tradition counts as granting liberation, alongside Varanasi, Ayodhya and others, and the Krishna Janmabhoomi complex built over the traditional site of his birth remains one of Vaishnavism's most visited pilgrimage destinations, closely linked to Vrindavan and the wider Braj pilgrimage circuit a short distance away.
Mathura's religious history did not begin with Krishna devotion, however. Excavation has shown the city was a major urban center by the mid first millennium BCE, and under the Kushan Empire in the first centuries CE it became one of the two great centers, alongside Gandhara, of early Buddhist image making, producing a distinctive red sandstone sculptural style that shaped Buddhist and Jain art across northern India; substantial Buddhist and Jain communities and monuments coexisted at Mathura for centuries before Vaishnava devotion to Krishna became its dominant public identity, a layering that the city's museums and excavated mounds still make visible.