For almost 60 years, the two countries, which agreed to normalize ties, have worked together closely but secretly on military and intelligence matters, assassinations, and migration of Jews to Israel.
Behind the announcement Thursday that Israel and Morocco will establish their first formal diplomatic ties, there lies almost six decades of close, secret cooperation on intelligence and military matters between two nations that officially did not acknowledge each other.
Israel has helped Morocco obtain weapons and intelligence-gathering gear and learn how to use them, and helped it assassinate an opposition leader. Morocco has helped Israel take in Moroccan Jews, mount an operation against Osama bin Laden — and even spy on other Arab countries.
The collaboration — uncovered in an array of interviews conducted and documents unearthed over many years — reflects a longstanding Israeli policy of building covert ties to Arab regimes where common interests — and enemies — could be found. In particular, Israel pursued a so-called periphery strategy, reaching out to more distant states that were far removed from the Israeli-Arab territorial dispute or that had hostile relations with Israel’s own enemies.
Moroccan Jews on the beach in Gibraltar in 1961 while in transit to Israel.Credit…Jack Garofalo/Paris Match, via Getty Images
The Moroccan-Israeli relationship stemmed in part from the large number of Jews in Morocco before the birth of Israel in 1948, many of whom would migrate there, making up one of the largest parts of Israel’s population. Some one million Israelis are from Morocco or descended from those who were, ensuring a deep, abiding interest in that country more than 2,000 miles away.
When Morocco gained independence from France in 1956, it banned Jewish emigration. Israel’s spy agency, Mossad, smuggled out many Jews, but the operation was exposed in 1961, when a Mossad ship carrying such migrants sank, killing most of those aboard.
The next month, a new Moroccan king, Hassan II, took power, and Israel made a highly successful effort to cultivate him. Israeli agents met with the Moroccan opposition leader, Mehdi Ben Barka, who asked for help overthrowing the king; instead, the Israelis told Hassan of the plot.
The king permitted mass emigration of Jews and allowed Mossad to establish a station in Morocco. Israel provided weapons and trained Moroccans in using them; it supplied surveillance technology and helped organize the Moroccan intelligence service; and the two shared information gathered by their spies — the start of decades of such cooperation.
King Hassan II of Morocco, right, confers with Prime Minister Yitzhak Rabin of Israel, second from left, and Israel’s foreign minister, Shimon Peres, left, in Rabat, Morocco, in 1993.Credit…Nati Harnik/Associated Press
A crucial moment came in 1965, when Arab leaders and military commanders met in Casablanca, and Morocco allowed Mossad to bug their meeting rooms and private suites. The eavesdropping gave Israel unprecedented insight into Arab thinking, capabilities and plans, which turned out to be vital to Mossad and the Israel Defense Forces in preparing for the 1967 war.
“These recordings, which were truly an extraordinary intelligence achievement, established our feeling, of the top I.D.F., that we will win the war against Egypt,” Gen. Shlomo Gazit, who later become the chief of military intelligence, said in a 2016 interview.
Shortly after that intelligence coup, at the request of Moroccan intelligence, Mossad located Mr. Ben Barka, the opposition leader, and helped lure him to Paris. There, Moroccans and allied Frenchmen abducted him. He was tortured to death, and Mossad agents disposed of the body, which was never found.
A decade later, King Hassan and his government became the back channel between Israel and Egypt, and Morocco became the site of secret meetings between their officials, ahead of the 1978 Camp David accords and normalization of relations between the former enemies. Israel later helped persuade the United States to provide military assistance to Morocco.
In 1995, Moroccan intelligence joined in an ultimately unsuccessful Mossad plan to recruit Osama bin Laden’s secretary, to find and kill the leader of Al Qaeda, according to a former Mossad official who was a partner in that planning, and who asked not to be named when discussing intelligence operations.
For years, Hassan II’s successor, King Muhammad VI, has sought Israel’s help in winning American acquiescence to Morocco’s annexation of Western Sahara, which finally came to fruition in Thursday’s announcement. Since 2006, Serge Bardugo, a leader of the small Jewish community remaining in Morocco, has been the king’s ambassador in that effort, meeting with Israeli officials and American Jewish leaders.
Occasionally these meetings were attended by Yassin Mansuri, a longtime friend of the king’s who heads Morocco’s external intelligence agency. Mr. Mansuri, in turn, met directly with his Israeli counterpart, Yossi Cohen, the chief of Mossad, conducting some of the negotiations that led to the agreement to normalize relations.