Udayin (c. 460-444 BCE) also known as Udayabhadra was a king of Magadha in ancient India. According to the Buddhist and Jain accounts, he was the son and successor of the Haryanka king Ajatashatru. 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 due to the latter's central location in the empire.
According to the Buddhist accounts, the successors of the Magadha ruler Bimbisara were Ajatashatru, Udayabhadda (Udayin), Anuruddha, Munda and Nagadasaka. The Jain tradition also mentions Udayin as the son and successor of Ajatashatru. However, the Puranas name the successors of Bimbisara as Ajatashatru, Darshaka, Udayin, Nandivardhana and Mahanandin. The Matsya Purana names Vamsaka as the successor of Ajatashatru. Since the Puranas were composed at a later date, the Buddhist tradition seems to be more reliable. The Nagadasaka of the Buddhist chronicles is identified with the "Darshaka" of the Puranas.
Professor H. C. Seth (1941) identified Udayin with the king Udayana mentioned in the Sanskrit play Svapnavasavadatta. The Chinese traveler Xuanzang states that the last descendant of Bimbisara built a sangharama (monastery) at Tiladaka. Seth theorized that this last descendant was Darshaka, and Udayin established a new dynasty, as signified by his transfer of the empire's capital from Rajgriha to Pataliputra. Liladhar B. Keny (1943) criticized Seth's theory as incorrect. According to him, the Udayana of Svapnavasavadatta was a different king, who ruled Vatsa kingdom with his capital at Kaushambi.
R. G. Bhandarkar notes that the name of Darshaka (Dasaka) is prefixed with the word "Naga" in the Buddhist chronicles, which may signify his detachment to his successors and his attachment to the Nagas of Padmavati . This implies that he may be from a different family and had become the king approximately three generations after Ajatashatru, not immediately succeeding him.
The Buddhist traditions state that Udayin was Ajatashatru's favourite son, and was alive during the reign of his grandfather Bimbisara. When Ajatashatru met Gautama Buddha, Udayin was a young prince. Udayin ruled during c. 460-444 BC. he established his capital at Pataliputra at the confluence of the Son and the Ganges rivers. His father had built a fort here to repulse a potential Pradyota invasion from Avanti. Udayin moved his capital to Pataliputra, probably because it was at the centre of his growing kingdom.
He defeated Palaka of Avanti multiple times but was ultimately killed by him in 444 BC. The Puranas mention Nandivardhana as the successor of Udayin. However, the Sri Lankan Buddhist chronicles state that he was succeeded by Anuruddha. These Buddhist chronicles also state that all the kings from Ajatashatru to Nagadasaka, including Udayin, killed their fathers. Jain texts mention that Uadyin was killed by an assassin of rival kingdom. Being childless, he was succeeded by Nanda who was selected by his ministers.