Lady Tonsok, daughter of Abdullah al-Muthaffariyye, was the wife of the Mameluke ruler Muthaffar al-Din. The lady dedicated the building at the end of the 14th-century to a Sufi order, a group of Muslim mystics, but continued to live in the palace until she died. She was buried in the tomb chamber across from the palace.
In the 16th-century Mameluke Jerusalem was conquered by the Ottoman army, which was armed with guns and cannons.
Under Ottoman rule Jerusalem became a frontier town at the edge of the Ottoman Empire, but the Temple Mount remained a major religious center. During this time the building was occupied by Hasseki Sultana, the most beloved of the wives of Sultan Suleiman the Magnificent, the builder of the walls around the city of Jerusalem. She was known for her charitable works and established a soup kitchen to feed poor and needy Muslims.
During the later Ottoman Period this became the site of the sar’iyye, the government building, which housed the local government and police force. Today the building is used as a vocational school.