King Udayin was the Indian ruler of Haryanka dynasty who ruled over Magadha from 460 BCE to 440 BCE. He was the son of Ajatashatru and grandson of king Bimbisara. King Udayin laid the foundation of the city of Pataliputra at the confluence of two rivers, the Son and the Ganges. He shifted his capital from Rajgriha to Patliputra because of the latter's central location in Magadha empire. He was succeeded by Anuruddha.