This architectural monument, located in the Nardaran settlement of Sabunchu district of Baku, is said to belong to the 8th century. The ruins of the shrine destroyed due to natural events were discovered during excavations in the village in the mid 20th century. During the excavation, the house of Mrs. Rahima and 3 springs were revealed. According to historical legends, the lady of Rahim is the daughter of the seventh imam, Abu'l-Hassan Musa ibn Jafar al-Kazim, of the Ahl-Bayt family. Rahima's khan's brother is Imam Rza, the eighth imam.
Like other shrines during the Soviet era, Rahim Khan khanum was expected to be demolished. However, the people of Nardaran used to stone the entrance of the shrine by day and prevented it, and at night they entered the shrine. In 1951, wheat was stored in a building that turned into a barn. It was only in 1956 that the locals gathered and cleaned the place and the sanctuary was restored to its former state. Since most of the restorers in Azerbaijan were Armenian by then, they had broken the inscriptions on stone books. Some of the books on Rahim Khanum's grave were thus destroyed.
The area, which was reconstructed in 1994, is 1,500 square meters and 1,600 people can pray at the same time.