The sixth Mughal Emperor Aurangzeb chose Lahore as the site for a new mosque, yet he was not a major patron of art and architecture like his predecessors. Instead of commissioning grand monuments for personal glory, Aurangzeb focused much of his reign on military conquests that expanded the Mughal realm. The Badshahi Mosque was constructed between 1671 and 1673 specifically to commemorate his military campaigns in southern India, particularly against the Maratha ruler Shivaji. This structure stands as a symbol of imperial power, built directly across from the Lahore Fort and its Alamgiri Gate, which was concurrently built by Aurangzeb during the mosque's construction. The mosque was commissioned in 1671, with construction overseen by the Emperor's foster brother and governor of Lahore, Muzaffar Hussein, also known by his title Fidai Khan Koka. After only two years of construction, the mosque was opened in 1673, becoming the largest mosque built during the Mughal era and currently the second largest mosque in Pakistan.
Stables and Gunpowder
On the 7th of July 1799, the Sikh army of Ranjit Singh took control of Lahore, marking a dramatic shift in the mosque's history. After the capture of the city, Maharaja Ranjit Singh used the vast courtyard as a stable for his army horses and converted its 80 Hujras, or small study rooms surrounding the courtyard, into quarters for his soldiers and magazines for military stores. In 1818, he built a marble edifice in the Hazuri Bagh facing the mosque, known as the Hazuri Bagh Baradari, which he used as his official royal court of audience. Marble slabs for the baradari may have been plundered by the Sikhs from other monuments in Lahore. In 1839, after his death, construction of a samadhi in his memory was begun by his son and successor, Kharak Singh, at a site adjacent to the mosque. During the First Anglo-Sikh War in 1841, Ranjit Singh's son, Sher Singh, used the mosque's large minarets for placement of zamburahs or light guns which were used to bombard the supporters of Chand Kaur, who had taken refuge in the besieged Lahore Fort. In one of these bombardments, the fort's Diwan-e-Aam, or Hall of Public Audience, was destroyed, but was subsequently rebuilt in the British era. During this time, Henri de La Rouche, a French cavalry officer employed in the army of Sher Singh, also used a tunnel connecting the Badshahi Mosque to the Lahore Fort to temporarily store gunpowder.The British Return
In 1849, the British seized control of Lahore from the Sikh Empire, and during the British Raj, the mosque and the adjoining fort continued to be used as a military garrison. The 80 cells built into the walls surrounding its vast courtyard were demolished by the British after the Indian Rebellion of 1857, so as to prevent them from being used for anti-British activities. The cells were replaced by open arcades known as dalans. Because of increasing Muslim resentment against the use of the mosque as a military garrison, by the help of Khan Bahadur Nawab Barkat Ali Khan the British set up the Badshahi Mosque Authority in 1852 to oversee the restoration and to re-establish it as a place of religious worship. From then onwards, piecemeal repairs were carried out under the supervision of the Badshahi Mosque Authority. The building was officially handed back to the Muslim community by John Lawrence, who was the Viceroy of British India. The building was then re-established as a mosque, marking a significant transition from a military stronghold back to a center of spiritual life.