After the Mahabharata battle, Barbarika head (Sheesh) was buried in the village of Khatu in present-day Rajasthan. The location was obscured until well after the Kaliyuga period began. Then, on one occasion, milk started flowing suddenly out of a cow’s udder when she neared the burial spot. surprised at this incident, the local villagers dug the place up and the buried head was discovered. The head was handed over to a Brahmin who worshipped it for many days, awaiting divine revelations as to what was to be done next. Roopsingh Chauhan, king of Khatu, then had a dream where he was inspired to build a temple and install the head therein. Subsequently, a temple was built and the idol was installed on the Shyam Baba Bhagati11th day of the Shukla Paksha (bright half) of the month of Kartik.
The original temple was built in 1027 AD by Roopsingh Chauhan and his wife Narmada Kanwar. In 1720 AD, a nobleman known as Diwan Abhaisingh renovated the old temple, at the behest of the then ruler of Marwar. The temple took its present shape at this time and the idol was enshrined in the sanctum sanctorum.
The idol is made of rare stone. Khatushyam is the family deity of a large number of families.
The temple is architecturally rich. Lime mortar, marble and tiles have been used in constructing the structure. The shutters of the sanctum sanctorum are beautifully covered with silver sheet. Outside is the prayer hall, named Jagmohan. its walls are highly painted, depicting legendary scenes. The entrance gate and exit gate are made of marble their brackets are also of marble and feature ornamental floral designs
There is an open space in front of the entrance gate of the temple. The Shyam Bagichi is a garden near the temple from where flowers are picked to be offered to the god. The Samadhi of Aloo Singh (a great devotee), is located within the shyam garden known as Shyam Bagichi near Khatu Shyam Baba ji Temple
The Gopinath temple lies to the south-east of the main temple. The Gaurishankar temple also lies nearby. There is an interesting tale associated with the Gaurishankar temple. It is said that some soldiers of the mughal emperor Aurangzeb wanted to destroy this temple. They attacked the Shiva lingam enshrined within this temple with their spears. Immediately, fountains of blood appeared from the Shiva Linga. The soldiers ran away, terrified. One can still see the mark of the spear on the Lingam.