The building, which involved persons from various cultural backgrounds in its construction, was the centre of an Islamic reform in the area during the 19th century. Future president Sukarno spent a time of exile at the mosque in 1942. It survived the tsunami which struck Padang following the 1833 Sumatra earthquake, but was severely damaged after earthquakes in 2005 and 2009.