The ramparts of Marrakesh, which stretch for some 19 kilometres (12 mi) around the medina of the city, were built by the Almoravids in the 12th century as protective fortifications. The walls are made of a distinct orange-red clay and chalk, giving the city its nickname as the "red city"; they stand up to 19 feet (5.8 m) high and have 20 gates and 200 towers along them.[28]