According to one legend, Lord Shiva was given his bow here, known as Ajgav, and so the place came to be known as Ajgaivinath. The ancient name of the place was Jahangira which was derived from the name of Jahnu Muni. Jahangira is a distorted form of Jahnu giri or Jahnu griha. Jahangira is now a small village forming a part of the town of Sultanganj. The name Jahangira for the rock had continued till at least 1824-25 when Bishop Heber visited the area. In Hebers Journal, Vol. I, there is a pencil sketch of the temple on the rock under the caption of Jahangira. The pencil sketch depicts a mosque by the side of the temple.
It is commonly said that Kala Pahar, in the course of his crusade against the Hindu temples, visited the place. He tried his best but failed to demolish Ajgaivinath temple. He could, however, destroy the Parvati temple on the neighbouring hill, and built a mosque there. Formerly the hill was much bigger and more spacious. This part of the Ganga has high floods with very strong currents almost every year and the decaying granite rocks of the hill are being slowly worn away. Traditionally Sultanganj formed a part of the great Anga State. In the days of the Mahabharata, Karna, the sixth brother of the five Pandavas, ruled in Anga. The capital of Anga was Champa. Champa is the present Champanagar situated three miles to the west of Bhagalpur. King Karna had his castles at Champa and Jahnugiri . At present Champanagar, the site of Karnas castle, is well known as Karnagarh. Karnagarh is practically a part of Bhagalpur town now. Some scholars have associated the large plateau of Karnagarh in Bhagalpur, where there are still ramparts of a fort, as one of the famous pre-Buddhist forts, The site had several bastions and ditches.
When the British took over, the area was selected for housing the Hill Rangers, a body of troops raised from among the Santals of Rajmahal Hills. For some time this was the headquarters of the wing of an Indian regiment and slowly the bastions have disappeared although the ditches are still there. The plateau is now mainly occupied by the State Constable Training School. Karnagarh area of Sultanganj which had King Karnas castle is also a large plateau. It is now called Krishnagarh, after the name of a zamindar of the branch of Raj Banaili, by the name of Kumar Krishnanand Singh, who built a large residential structure on the site.
The temple is solidly built on the rock and has got a series of marvellous rock sculpture and some inscriptions. Some of the specimens of the rock panel sculpture at this temple can hold their own against any of the best-known specimens anywhere in India. Not much study, unfortunately, has been made of the rock sculpture and inscriptions here. The sculpture could be taken to be the later Pala period. The site is very attractive and, particularly during the rainy season, the splashing waters of Mother Ganga wash the feet of the temple.
Shravani Mela Shravani Mela is a month-long festival which is celebrated in July - August of every year by devotees of Lord Shiva