Bari Imam (1617 to 1705), whose real name is Shah Abdul Latif Kazmi, was born in 1026 Hijra (1617 AD). His father, Syed Mehmood Shah, shifted his family from Jhelum District to Baghan village, presently called Aabpara. At that time, it was a barren land. Soon after the arrival of Bari Imam's family, his father started farming and also kept some animals. Shah Latif helped his father in grazing the animals, but left his father at 12 and came to Nurpur Shahan. From Nurpur Shahan, Bari Imam went to Ghaur Ghashti (now known as Attock) where he stayed for two years for learning fiqh, hadith, logic, mathematics, medicine and other disciplines, because at that time Ghaur Ghashti was great seat of learning.
The Saint Bari Imam used to live in a cave, where he was visited by wild animals and djinns. A rock in the cave which resembles a snake is said to be a real snake turned into stone by the Holy man. There is a fire burning in the cave for some 300 years now, and a tree in front of the cave is said to bee also 300 years old. According to legend Bari Imam lived a hermits life in this cave for twelve years.
To get spiritual knowledge and satiate his love for Islam, Bari Imam visited many places, including Kashmir, Badakhshan, Bukhara, Mashhad, Baghdad and Damascus. He not only received spiritual knowledge in these places but also held discussions with scholars belonging to different schools of thought on various subjects. Later, he went to to perform Hajj.
Bari Imam received spiritual knowledge from Hayat- al-Mir (Zinda Pir). His 'Pir' gave him the title of Bari Imam, which proves his link to Syed family. Bari Imam converted thousands of Hindus into Muslims through the teachings of Islam at Nurpur Shahan. It is stated that once Mughal Emperor Aurangzeb Alamgir himself came there to pay respects to Bari Imam.
A celebrated miracle worker, Bari Imam is also described in regional lore as one through whom God performed many marvels to convince the local people of the truth of Islam; thus, some of the most popular miracles ascribed to him are his having caused water to gush forth from rocks and his having brought back to life the dead buffaloes of a peasant who had earlier provided the saint with milk during his ten years of spiritual seclusion. Bari Imam died in 1705 and was buried at Nurpur Shahan.
The Mughal emperor Aurangzeb who revered Bari Sarkar originally built the silver-mirrored shrine of Bari Imam in 17th century. It has since been renovated many times, and is now maintained by the Government of Pakistan. Until the 1960s, the shrine was famous for its urs celebration, when the death anniversary of the saint was commemorated and which was attended by hundreds of thousands of people each year (in one particularly populous year, the attendance is said to have been 1.2 million people).
Inside the mausoleum, where the great saint rests, only men are permitted, a steady stream of worshippers enter and exit, most bending to kiss and strew rose petals on the green cloth covering the grave of Hazrat Bari Sarkar [RA]. The shrine is a tourist spot in the tour guide's list. Every year as the Urs of the saint, who spread Islam in this part of the world, gains momentum, devotees in their thousands set out for the Margalla foothills and gather at Nurpur Shahan to pay their respect.