 As early as the 17th century, Moulay Ismaïl, who was looking for allies against Spain, had excellent relations with Louis XIV of France.He sent to the Sun-King ambassador Mohammad Temim in 1682.There was cooperation in several fields.