When the Jews began to disperse throughout the Roman
empire after the dissolution of the Jewish state in 70, many
settled in Mauretania including part of modern-day
Morocco.
In the 7th century the Jewish population of
Mauretania received as a further accession from Iberian
peninsula those who wished to escape west-Gothic legislation.
At the end of the same century, at the time of the great Arab
conquests in northwestern Africa, there were in Mauretania,
according to the Arab historians, many Jews.
More about the history of the Jews in Morocco is found in External
links and The Jews
and "Mellah"

The Star of David, a Jewish
symbol carved in sandstone on this portal in Jrayfat

"The accession to the throne of Yazid,
on the death of Mohammed III in 1789, led to a terrible massacre
of the Moroccan Jews, having refused him their support in his
fight with his brother for the succession".....
......... "In Mogador, strife arose between the Jews and
the city judge on the one hand, and the Moorish citizens on
the other; the dispute was over the question of Jewish garb.
Finally the Jews were ordered to pay 100,000 piasters and three
shiploads of gunpowder; and most of them were arrested and beaten
daily until the payment was made. Many fled beforehand to Gibraltar
or other places; some died as martyrs; and some accepted Islam."
http://en.wikipedia.org/wiki/History_of_the_Jews_in_Morocco
"The condition of the Jews has always been better in Mogador
than in many other parts of the empire, as the sultans—especially
those of the Sherifian dynasty—in many instances favored
them. An exception, however, was made in this respect by the
sultan Muley Yazid, who in order to convert
ten Jews of Mogador tortured them for ten days by repeatedly
hanging them head downward in a dry cistern and bastinadoing
them. When the news of the death of Muley Yazid came, some of
them had expired and one had embraced Islam; the rest were set
free."
http://www.jewishencyclopedia.com/view.jsp?
artid=695&letter=M#ixzz1QHtFFHNb
Rabbis in Mogador
Yahya, from Agadir
Jacob Bibaz, from Rabat;
Abraham Coriat, author of "Sefer Zekut Abot"
(went to Leghorn in 1793)
Hayyim Pinto (d. 1845)
David ibn al-Hazzan (d. 1828)
Joseph ben Jacob Almalih, called Joseph al-Kabir
(d. Jerusalem 1837)
Abraham Coriat II., author of "Sefer Berit Abot"
Joseph ben Aaron Almalih
Abraham ibn 'Attar (d. 1882)
Moses Cohen (emigrated to the city of Morocco)
Abraham Sabah (d. 1903)
Judah ben Maniel, Mas'ud Knafo Joseph ibn 'Attar
(1904)
Read more: http://www.jewishencyclopedia.com/view.
jsp?artid=695&letter=M#ixzz1QHu7O62m