During 14th century, under the Berber dynasty Merinids, the town rose in importance as a port and in the early 15th century, became independent once again.
The town and the medina of Casablanca as it is today was founded in 1770 AD by sultan Mohammed ben Abdallah (1756-1790), the grandson of Moulay Ismail.