The name Bihar is derived from the Sanskrit and Pali word, Vihara (Devanagari: विहार), which means “abode”. The region roughly encompassing the present state was dotted with Buddhist vihara, the abodes of Buddhist monks in the ancient and medieval periods. Medieval writer Minhaj al-Siraj Juzjani records in the Tabakat-i-Nasiri that in 1198 AD, Bakhtiyar Khalji committed a massacre in a town now known as Bihar Sharif, about 70 km away from Bodh Gaya. Later, Bakhtiyar learned that the town was a college, and the word for college is bihar.
Different regions of Bihar like Magadha, Mithila, Anga, Vaishali are mentioned in different religious texts and epics of ancient India. The power centre of ancient Bihar was around the region of South-West Bihar called Magadha, which remained the centre of power, learning, and culture in India for 1000 years.
The Haryanka dynasty founded in 684BC ruled Magadha from the city of Rajgriha(modern Rajgir), two well known kings were Bimbisara and his son Ajatashatru who imprisoned his own father to get the throne. Ajatashatru founded the city of Patliputra which later became the capital of Magadha. He declared war and conquered Vajji another powerful Mahajanapada north of Ganges with their capital at Vaishali. Vaishali was ruled by Licchvi who had a republic form of government where king was elected from the number of rajas. Haryanka Dynasty was followed by Shishunaga dynasty and later Nanda Dynasty replaced them with a vast empire from Bengal to Punjab.