RABAT, Morocco (AP) — The governments of Spain and Morocco signed deals Thursday on managing migration and boosting Spanish investment in Morocco, among 20 agreements reached at wide-ranging meetings aimed at turning the page on diplomatic tensions linked to the disputed Western Sahara.

Morocco is an ally to Western powers in fighting extremism and important in aiding EU migration policies, and Spanish Prime Minister Pedro Sánchez applauded what he described as a trust-building step at the signing ceremony in Rabat.

The documents inked Thursday included an 800-million-euro ($873-million) package to encourage investment by Spanish firms in Morocco, two memorandums on migration and several deals for education and job training. Details were not released.

The meetings, which involved 11 Spanish ministers and 13 from the Moroccan government, also produced an agreement to open customs offices on the border crossings at Spain’s North African enclaves of Ceuta and Melilla, which Morocco doesn’t officially recognize as European territories.

This should be a boost to the local economies on both sides of the border. Prior to the COVID-19 pandemic, the land crossings were porous to flows of contraband goods, and now the goal is for goods to move on trucks and with duties duly paid.

The frontiers are also often sites of tragedy for Africans who try on occasion to storm the fences in hopes of continuing on to continental Europe. The border policing methods of both Spain and Morocco fell under intense scrutiny after the death of at least 23 African men, many reportedly refugees from Sudan, when they stormed a border fence at Melilla last year.

Morocco has reaped economic benefits from the EU in exchange for curbing irregular immigration to Spain. But Morocco’s efforts have failed to fully stop thousands of people, including young Moroccans looking for a better future in Europe, from attempting a dangerous crossing of the Mediterranean or a perilous Atlantic journey to the Canary Islands.

Moroccans make up the single largest foreign community in Spain, with 800,000 residents; Spain is the largest foreign investor in Morocco, making economic cooperation a top priority for the Moroccan government.

The Spanish government’s visit is seen as an effort to get something tangible in return for diplomatic efforts to mend ties with Morocco after a flareup in tensions over the Western Sahara, a former Spanish colony annexed by Morocco in 1975.

Sánchez insisted Thursday on the importance of improved paths of communications between governments with the intention of avoiding “unilateral actions, and never leaving out any topic regardless of its complexity.”

“We are establishing the basis for the type of relations between Spain and Morocco for the present and the future … based on mutual trust,” Sánchez said.

Moroccan Prime Minister Aziz Akhannouch praised the “renewed dynamism of our relations.”

He also thanked Spain for its support of its proposal for Western Sahara.

Spain incurred Morocco’s wrath in 2021 by allowing a Western Sahara independence fighter to seek treatment in a Spanish hospital. Sanchez then took the controversial decision to throw Spain’s backing behind Morocco’s vision for the future of the territory — more autonomy but remaining firmly under Moroccan control — to smooth over tensions.

That angered Algeria, a major natural gas supplier to Spain and backer of the Polisario Front movement that has fought for Western Saharan independence. Politicians from across Spain’s spectrum considered Sánchez to have betrayed the Sahrawi people of Western Sahara for very little gain in return.

One person was notably absent from the Spanish visitors’ agenda in Morocco: King Mohammed VI.

He and Sánchez spoke by telephone on Wednesday about a “new era” in relations, according to the Spanish prime minister’s office. Sánchez was scheduled to pay a visit Thursday to the gravesite of the king’s grandfather, Mohammed V.

Sánchez met with the king last year to put an end to the diplomatic crisis.


Joseph Wilson in Barcelona, Spain and Angela Charlton in Paris contributed.