Although Maghreb was less attractive for France, than the Middle East, Napoleon's government and French business community were well aware of its value. Among all North African countries Morocco could become for France the most interesting partner. This state of thousand-year-old history was the only Mediterranean Muslim country independent from the Ottoman Empire, while three other territories ‑ Alger, Tunis and Tripoli ‑ were nominally submitted to the Ottoman Sultan. Morocco carried on trade with Europe, struggled against piracy and had modern though obscure for the Europeans state system. Morocco controlled one of the shores of Gibraltar – thus, the country interested Napoleon in commercial and especially in the strategic sense. At first Franco-Moroccan relations had been sluggish but than in Tilsit period they became warmer. However these relations were deteriorated by Spanish occupation and by imperial claims of France that all pushed Morocco into the arms of England.