The castle was built by Mohammed ben Abdallah in the 18th century, but is mistakenly referred to as "The Portuguese Castle" by local guides. This is a confusion with the Portuguese castle built in 1506 in the Essaouira city harbour by the Portuguese, the Castelo Real.