According to the first-century Jewish historian Josephus, Jews were first settled in Cyrene and other parts of present-day eastern Libya by the Egyptian ruler Ptolemy Lagos (323-282 B.C.E.) With their numbers likely bolstered by Berbers who had converted to Judaism, later supplemented by Jews fleeing the Spanish and Portuguese Inquisition, and, from the seventeenth century, by Jews from Leghorn and other Italian cities, Jews lived continuously in Libya for well over two millennia, predating the Muslim conquest in 642 C.E. by centuries.
In 1911, 350 years of Ottoman rule ended and the Italian colonial period began. At the time, Libya’s Jewish population numbered 20,000. The next quarter century was to prove a golden age for Libya’s Jews. By 1931, nearly 25,000 Jews lived in Libya. The introduction of anti-Jewish legislation in Fascist Italy was extended to Libya in 1936. By 1940, Libya became the scene of heavy fighting between the Axis and British armies.
Pan-Islamic and anti-Jewish propaganda, fueled by the Arab League and coupled with the rise of Libyan nationalism, led to Muslim rioting in 1945 in the Tripolitania province. Decades of reasonably cordial relations with Muslims came to an end. Jews began to consider “Aliyah”, immigration to Palestine, and by 1952, 33,000 Libyan Jews had emigrated to Israel.
check out this website for more:
History of the Jews in Libya