Rise of Magadha under the Haryanka Dynasty
Among the 16 mahajanapadas, Kasi was initially powerful. However, Kosala became dominant later. A power struggle broke out between Magadha, Kosala, Vrijji and Avanti. Eventually Magadha emerged as the dominant mahajanapada and established the first Indian empire. The first known ruler of Magadha was Bimbisara of the Haryanka dynasty. He extended the territory of Magadhan Empire by matrimonial alliances and conquests. By marrying off his sister to Prasenajit, ruler of Kosala, he received Kasi as dowry. He also married the princesses of Lichchhavis and Madra. He maintained friendly relations with Avanti but annexed Anga by military might. Thus, Magadha became a powerful and prominent power. During his reign, Bimbisara patronised various religious sects and their leaders. He had an encounter with Buddha as well.
His son Ajatashatru ascended the throne by killing his father. King Prasenajit immediately took back Kasi, which he had handed out as dowry to Bimbisara. This led to a military confrontation between Magadha and Kosala. The struggle lasted until Prasenajit was overthrown and died at Rajgriha, the capital of Magadha Empire.
Kosala was then annexed to Magadha. Ajatashatru also fought and won the battle against the Lichchhavis. He defeated the Lichchhavis and the Mallas. Ajatashatru is also believed to have met Buddha in his lifetime. By the time Ajatashatru died in 461 BCE Magadha had become undisputedly the strongest power.
The Haryanka dynasty was succeeded by the Shishunaga dynasty. Shishunaga, a viceroy of Benaras, deposed the last Haryanka king and ascended the throne. The Shishunagas ruled for fifty years before the throne was usurped by Mahapadma Nanda.