Peer Budhan Ali Shah, who some claim was born an Arab named Shams-ud-din, (Sun of the faith) was a Sufi Muslim saint who some say, lived 500 to 800+ years. He is also said to have been born in Talwandi (now known as Nankana sahib), the birth place of Guru Nanak sahib. He lived in the area of today's Kiratpur, long before the township was established. It is said that he also kept a lion, which would daily take the goats into the forest to graze. One day Guru Nanak Devji visited to discuss spiritual matters with the Pir. Noting it was about time for the lion to return with the goats, the Pir told the Guruji he was worried his lion might attack him. Guru Nanak devji is said to have replied, "If your lion does not eat you why would he bother me." The Guru was not bothered and to the utter surprise of the Pir, as the lion returned, it bowed to the Guruji and touched his feet. Seeing this the Pir realized the greatness of the personality of Guru Nanak. His host then offered Guru Nanak a full glass of fresh milk of which Guru sahib took only half of the milk and told Pir Budhan to save the other half of the same that he would ask for it in his future incarnation during the period of the sixth Padshahi, Guru Hargobind Sahib more than 60 years later. Another version of this story mentions that the future visitor being a Sikh by the name of Gurditta.
Guru Nanak Devji also said that he would establish a town at the site one day. Years and years passed in waiting. The Pir grew very old. One day Guru Hargobindji deputed his son Baba Gurditta to visit the Pir and accept the milk. Baba Gurditta reached him, and asked for milk.
The Pir who had been longing for the time felt very happy and asked him to establish a town at that very site. The town was developed and was named as 'Kirat Pur.' As the ancient Pir was praying for the Darshan of Guru Sahib, Guru Hargobindji appeared. Pir Buddan Shah then expressed his gratefulness and left his body for his journey to eternity.