Guru Nanak Dev ji instructed Bhai Mardana to pick up a spade and go to the nearby river. He told Bhai Mardana to drag the river behind him with the spade without seeing back.
Bhai Mardana did as instructed and the river started to follow him as he dragged his spade over the ground. When he reached this place, Bhai Mardana looked back to see if the river was coming behind him.
Immediately, the river stopped following him and stopped at this place. When the river stopped its flow, Guru ji asked the yogis to use their occult powers and move the river further at the place where Guru Ji was sitting. However much they tried, the yogis could not do so. They realized their fault and fell at the feet of the Guru Ji, accepting their defeat. A baoli was constructed here thereafter known as Baoli Sahib.