The Prophet Mohammed offered prayers at the mosque after arriving with an army of 30,000 men for the Battle of Tabuk against the Byzantines. Originally constructed of bricks, mud and palm-tree trunks, the mosque was restored in 1652 and again in the early 20th century.