Its construction was completed in 1860 by his son Maharaja Ranbir Singh. However, according to an inscription in Brahmic script (Takri) at the entrance of the temple, Gulab Singh and his brother Dhyan Singh are credited with building the temple in 1827 in honour of Mahant Jagannath. During the reign of Ranbir Singh, the temple complex started a "pathshala" (school) which welcomed students from all castes and classes. The temple housed a library with some 6,000 manuscripts. These are mostly copies made from manuscripts not available for sale, in Devanagari from Sarada originals, by scribes employed by the library in the nineteenth century. The library added to its collection, in the 19th century, a dozen rare Sanskrit birch bark codices in the Sarada script as an object of curiosity. The collection as indexed by Stein, included Sanskrit manuscripts (predominantly Devanagari) of Vedic literature, grammar, lexicography, prosody, music, rhetoric, Kavya, drama, fables, dharmasutras, Mimamsa, Vedanta, Samkhya, Yoga, Nyaya, Jyotisha, Architecture, Medicine, Epics, Puranas, Bhakti and Tantra.