sultan of
Morocco,
Ismail Ibn Sharif The capitulation was negotiated in
Meknes with Mawlay Ismail by Gaspar Gonzáles, who was an envoy of the governor of Larache, Fernāndo Villorias y Medrano himself, who had been captured during the siege. According to the agreement, the governor and 100 officers would be able to freely return to Spain, while the rest of the garrison with a total of 1,700 men would be taken to
Meknes. However the sultan did not respect this agreement in any way, and so the governor and the hundred officers would also be taken to
Meknes. Several exchange requests have been made on both sides. Initially, a Spaniard named Manuel de Vaira Lobo was sent to negotiate the release of the officers as well, as the governor. But the Moroccan sultan Mawlay Ismail thus asked for the release of a thousand Moroccans, in a ratio of 1 Spanish officer for 10 Moroccans. In a first treaty, it was agreed that 500 Moroccans as well as 5,000 Arabic books of the
Escorial library be exchanged for the officers. Mawlay Ismail went so far as to send a man named Mohammed al-Wazir al-Hassani to examine the books; he stayed in Spain from November 1690 to July 1691, but when he arrived, the religious authorities lied to the Moroccan sent by Mawlay Ismail, telling him that everything had burned down after the fire in the
Escorial library in 1671. Thus Spain was forced to accept the first request of Mawlay Ismail which asked for the release of 1,000 Moroccans against 100 Spanish officers. After the confirmation of this exchange, the consul of France in
Salé Jean-Baptiste Estelle affirmed that it was "A beautiful agreement concluded" in February 1691. As the Spanish officers were on their way to
Ceuta, a thousand Moroccans were waiting for them there for the exchange, the sultan even claimed that the King of Spain only exchanged aged and ill Moroccans, but kept the healthy ones. The former soldiers of the Spanish garrisons based in the coastal towns of Morocco, captured by the Moroccans, were converted to
Islam by the hundreds. The exchange finally took place in
Ceuta in September 1691, but according to the French consul of
Tangier, Pierre Estelle, the operation was very expensive, apart from the Moroccans exchanged for Spain. == Aftermath ==