The madrasa in the Sunni world was generally antithetical to more "heterodox" religious doctrines, including the doctrine espoused by the Almohad dynasty. As such, it only came to flourish in Morocco in the late 13th century, under the Marinid dynasty which succeeded the Almohads.[9] To the Marinids, madrasas also played a part in bolstering the political legitimacy of their dynasty.