During the 1830's a wealthy merchant sent his servant, the pious Sayid Niaz Shekilar, on a journey to buy some Arab gum. As Shekilar was returning with his camel caravan, he discovered a large pouch of gold coins within one particularly heavy sack. The honest servant immediately returned to the traders who had sold him the gum but they knew nothing about the mysterious money. Perplexed and unsure as to what to do next, Shekilar approached Allah Kuli Khan in Khiva, asking him to add the gold to the Khanate's coffers. However the Khan's advisors were reluctant to receive money from an unknown and potentially unclean source and suggested that it might best be spent on the building of a new mosque or madrassah.
Shekilar decided to build both and used the money to buy land. A community-minded citizen, he was keen to involve the locals in the construction of the new buildings and assembled them together for the laying of the first brick. Shekilar announced that whoever amongst the crowd had never missed a single 'namoz' would be worthy of laying the first stone. Shekilar waited as they looked down and shuffled their feet, soon realising that he was the only person present who fulfilled the criterion. Having laid the first brick himself, he called on the community to make and bring bricks for the mosque.
For each brick, Shekilar rewarded its owner with a nut. One man regularly appeared carrying a heavy load of bricks but would promptly vanish after having laid them down and before long Shekilar realised that this was the elusive Saint Hissirl. Slowly the buildings began to take shape but Shekilar ran up against a problem. Although he had brought most of the land needed for the ensemble, there was still a sizeable corner belonging to an old woman called Yulmanbai. Approaching her, he asked if she would be willing to sell her land for the building of the mosque. Yulmanbai shook her head firmly and absolutely refused. 'However,' she said, 'If you bury me in the mosque you can have my land for free.'
As a result the two tombs located inside the winter mosque belong to Shekilar and the old woman, Yulmanbai. The complex was eventually completed in 1842 and the mosque built for peanuts continues to stand to this very day.