Following the invasion of Spain from the coast of Morocco by the Berber Commander Tariq ibn Ziyad in 711, during the 8th century Arab and Berber armies invaded Southern France, as far as Poitiers and the Rhône valley as far as Avignon, Lyon, Autun, until the turning point of the Battle of Tours in 732.
Cultural exchanges followed. In the 10th century, the French monk Gerbert d'Aurillac, who became the first French Pope Sylvester II in 999, traveled to Spain to learn about Islamic culture, and may even have studied at the University of Al-Qarawiyyin in Fes, Morocco.
France would become again threatened by the proximity of the expanding Almoravid Empire in the 11th and 12th centuries.
In the 16th century, the sealing of a Franco-Ottoman alliance between Francis I and Suleiman the Magnificent permitted numerous contacts between French traders and countries under Ottoman influence. In 1533, Francis I sent as ambassador to Morocco, colonel Pierre de Piton. In a letter to Francis I dated August 13, 1533, the Wattassid ruler of Fes, Ahmed ben Mohammed, welcomed French overtures and granted freedom of shipping and protection of French traders. France started to send ships to Morocco in 1555, under the rule of Henry II, son of Francis I.