When the Almohads first conquered Morocco and Spain from the Almovarids in the 1100s AD, they showed their strength by building monuments in the cities of their new empire. They built this mosque right over the top of the old Almovarid palace in Marrakesh! Also, the Almoravids had not allowed people to build minarets, which they thought were wrong, so the Almohads built lots of minarets to show that things had changed. An architect named Jabir designed the Koutoubia minaret. (Compare this minaret to the Romanesque bell tower of St. Germain des Pres in Paris, which was built about a hundred years earlier).
Jabir, who designed the Koutoubia minaret, also designed minarets in many other places, like Seville in southern Spain. Most of this minaret is Almohad (though Christians added the very top part in the 1300s). The tower has no stairs; instead it has ramps inside it, wide enough so that the muezzin (the man who sang the call to prayer) could ride a horse up all the ramps to the top. People sometimes say that the Giralda was the tallest building in the world at that time, but actually the Pharos (Lighthouse) of Alexandria was probably considerably taller, and it was still standing until about 1310 AD.