Demak’s venerable Mesjid Agung (circa 1466), notable for its triple-tiered roof, is Java's oldest mosque and one of the archipelago’s foremost Muslim pilgrimage sites. Legend has it that it was built from wood by the wali songo (nine holy men) in a single night. Four main pillars in the central hall were originally made by four of the Muslim saints, and one pillar, erected by Sunan Kalijaga, is said to be made from scraps of timber magically fused together.
Today the history of the mosque is outlined in a small museum (rarely open) that exhibits some of the original woodwork, including magnificent carved doors.
The tombs of Demak’s rulers lie next to the mosque; the tomb of Raden Trenggono (leader of Demak’s greatest military campaigns) attracts the most pilgrims, a steady stream of whom file through the mosque compound day and night.
Mesjid Agung lies on the main road in the centre of town, beside the huge grassy alun-alun.