From the end of the 16th century, the Netherlands had been attempting to establish friendly relations with Islamic countries, such as the Ottoman Empire and Morocco, due to their common enmity with Spain. Some meagre attempts took place under Ahmad al-Mansur until his death in 1603. In April–May 1605, Pieter Marteen Coy returned to Safi in Morocco and Algiers 135 Muslim captives, both Turkish and Moorish, who had been seized by the Dutch in a naval encounter with Spanish galleys. From 1605, Coy became representative of the States General in Marrakesh. From 1608, the new Moroccan SultanMulay Zidan, developed a Treaty of Friendship with the Low Countries, and sent several envoys there, such as Samuel Pallache, Hammu ben Bashir, Muhammad Alguazir, Al-Hajari and Yusuf Biscaino. As a result of these exchanges, the Dutch are known to have sent 3 warships requested by Mulay Zidan. Philip III of Spain used these military exchanges as one of the justifications for his expulsion of the Moriscos from Spain in 1609. A "Treaty of Friendship and Free Commerce" was signed between the two countries in December 1610, offering "free access and friendly reception for their respective subjects with any need for safeguard or safe-conduct, no matter how they come to the others' territory". In 1613, Al-Hajari visited the Dutch Republic, which he could visit freely due to the existence of a Treaty of Friendship. He stayed from June to September. He discussed with the Dutch Prince Maurice of Orange the possibility of an alliance between the Dutch Republic, the Ottoman Empire, Morocco and the Moriscos, against the common enemy Spain. His book mentions the discussion for a combined offensive on Spain, as well as the religious reasons for the good relations between Islam and Protestantism at the time:
Islamic studies
Religious discussions also occurred. The early embassy of Hammu ben Bashi in late-1609 early-1610, led to the redaction of a polemical pamphlet about Christology entitled Inquisitio et responsio quae fuit inter Mahumetitsam et Christianum de Mesia ad intelligendum an ille sit filius Dei nec ne. One of the ambassadors, Yusuf Biscaino, met with Prince Maurice of Nassau who inquired to him about Islamic opinions on Jesus. He preferred not to answer on the spot, but later sent a letter to Maurice. After returning to Marakesh, Yusuf Biscaino sent the letter in Latin to Maurice in 1611, relying as a source on the work of Muhammad Alguazir. One of the effects of these exchanges was the remarkable development of Arabic and Islamic studies in the Netherlands, exemplified by the work of Thomas Erpenius. Thomas Epernius was able to advance his knowledge of Arabic through direct exchanges with Moroccan envoys, such as Al-Hajari. Al-Hajara had used the Treaty of Friendship in order to visit the Netherlands freely after a sojourn in France. Thomas Epernius became professor of Oriental Languages at Leiden University in 1613.
On 25 June 2017, the Moroccan Ministry of Foreign Affairs recalled summoned its ambassador in the Netherlands as a gesture of protestation, that came after Said Chaou, a Moroccan dissident established in the Netherlands, appeared in a Facebook live video, commenting the current events in the Hirak Rif. The Moroccan side reiterated its wishes to see Chaou extradited to Morocco where an arrest mandate has been issued for him since 2010, by judge Nourreddine Dahen. The Dutch response was that whilst it was committed to cooperation with the Moroccan government in strict respect of international law, it considered the reaction of the Moroccan government "incomprehensible and futile".