When the Saadians held power in Morocco in 1549, the Ottomans became troubled of losing the support they have from the Sufis side in western Oran. Thus, an agreement was made between the Ottomans and Saadians stipulating the division of the territories of the former Kingdom of Tlemcen. According to the agreement, the Moroccans would retrieve Tlemcen, except for Oran, that would remain under Ottoman rule.