Gaya district is one of the thirty-eight districts of the Indian state of Bihar. It was officially established on 3 October 1865. The district has a common boundary with the state of Jharkhand to the south. Gaya city is both the district headquarters and the second-largest city in Bihar. Gaya finds mention in the great epics, Ramayana and Mahabharata. Ram along with Sita and Lakshman visited Gaya for offering Pind-Daan to their father Dasharath. In Mahabharata, the place has been identified as Gayapuri. About the origin of the name ‘Gaya' as referred to in Vayu Purana is that Gaya was the name of a demon (Asura) whose body was pious after he performed rigid penance and secured blessings from Vishnu. It was said that the Gayasura's body would continue to be known as Gaya Kshetra. Gaya has experienced the rise and fall of many dynasties in the Magadh Region. From the 6th century BC to the 18th century AD, about 2300–2400 years, Gaya has been occupying an important place in the cultural history of the region. It opened up with the Shaishunaga dynasty founded by Shishunaga, who exercised power over Patna and Gaya around 600 BC. Bimbisara, fifth in line, who lived and ruled around 519 BC, had projected Gaya to the outer world. Having attained an important place in the history of civilisation, the area experienced the bliss of Gautam Buddha and Bhagwan Mahavir during the reign of Bimbisara. After a short spell of Nanda dynasty, Gaya and the entire Magadha region came under the Mauryan rule with Ashoka (272 BC – 232 BC) embracing Buddhism. He visited Gaya and built the first temple at Bodh Gaya to commemorate Prince Gautama's attainment of supreme enlightenment. The period of Hindu revivalism commenced with the coming of the Guptas during the 4th and 5th century A.D. Samudragupta of Magadh helped to bring Gaya in limelight. It was the headquarters of Behar district during the Gupta empire. Gaya then passed on to the Pala Empire with Gopala as the ruler. It is believed that the present temple of Bodh Gaya was built during the reign of Dharmapala, son of Gopala.