According to legend, this mosque was erected by all of wali songo, nine saints that spreaded Islam over Java, only in one night. Demak chronicle shows that Demak Mosque was built in 1399 Saka or 1477 by candra sankalan ‘lawanh trus gunaning janmi’ while on the turtle figure on depicts on the mosque mihrab,there is a symbol of 1401 Saka or 1479.
The building was made of teak wood with size of 31 meters square and the veranda is 31 meters x 15 eters. The middle roof is supported by 4 gigantic pillars called saka guru, that was made by 4 of the wali songo. The south east pillar was made by Sunan Ampel, southwest pillar by Sunan Gunung Jati, north west pillar by Sunan Bonang and north east by Sunan Kalijaga. The later mentioned pillar is made of blocks of woods, not intact wood, that are bound together. The veranda has 8 pillars as the addditional cuilding in Adipati Yunus period (Pati Unus or Pangeran Sabrang Lor), second Demak sultan (from 1518 to 1521) in 1520.
In the construction process, Sunan Kalijaga held an important role, as he decide the kiblat direction. According to local believe, Sunan Kalijaga achieved antakusuma gift, clothing, from prophet Muhammad. The gift fell from the sky when he was on a meeting in the mosque.
The pillars are decorated with hindu style carving in beautiful design. Carving also decorated the mosque wall that were designed as ornaments.
The main building located main room, mihrab and veranda. Main room is utilized as praying room, located in the middle of the building. While mihrab or imam room, located in front of the main room and faced kiblat (Mecca). The rear of the main room is a veranda.
The roof is three terraces made of wood and the top is completed with dome. The mosque wall is made of stone and limestone. The entrance is decorated with classical painting. And like other mosques, this mosque has bedug (drum), gentong (earthen ware) for wudhu, water pool, podium and chinese ceramics.