Israeli President Isaac Herzog has thanked Morocco's King Mohammed VI for his country's provision of "safe haven" for Jews during the Holocaust.
Mr Herzog's letter, marking two years since Morocco normalised ties with Israel, was the first time an Israeli official has paid tribute to the Holocaust-era actions of Morocco's monarch at the time, the presidency said.
He expressed Israel's gratitude to the king "and the people of Morocco who, for generations, have acted to protect the security, welfare and cultural heritage of the kingdom's Jewish community".
Mr Herzog mentioned Jews settling in Morocco after their expulsion from Spain in the late 15th century, before noting the North African country's protection of Jews during the Second World War.
"When millions of Jews faced the horrors of the Holocaust in the 20th century, King Mohammed V provided a safe haven for his Jewish subjects," Mr Herzog said in the letter, dated December 22.
"Moroccan Jews recall with pride and affection the memory of your grandfather, His Majesty King Mohammed V, who is remembered as the protector and guardian of Jews in his realm."
Mohammad V is famous for his refusal to apply anti-Jewish laws prescribed by France's pro-German Vichy government during the war.
Mr Herzog praised the current king's moves to support his country's Jewish community, noting the decision to include Holocaust education in Moroccan schools.
It would not only deepen "your people's commitment to tolerance and understanding but send a powerful message about these essential values to countries from the Atlantic to the Gulf", he wrote.
The presidency said the letter was co-ordinated with Israel's Foreign Ministry and the state's Yad Vashem Holocaust centre.
Rabat cut relations with Israel in 2000 after the outbreak of the second Palestinian intifada.
But in December 2020, the two countries formalised ties, following the signing of the Abraham Accords between Israel and the UAE and Bahrain.
Before then, Israel had reached peace treaties with neighbouring Egypt and Jordan, in 1979 and 1994.
Morocco's Jewish community dates to antiquity and grew in the 15th century with the expulsion of Spain's Jews.
By the 1940s its number had grown to 250,000, representing 10 per cent of the country's population, but mass emigration followed Israel's founding in 1948.
The kingdom's Jewish community is now estimated to number about 3,000 people, the largest in North Africa.
About 700,000 Israelis claim Moroccan descent and maintain strong ties with it.