The history of the Jews in Libya stretches back to the 3rd century BCE, when Cyrenaica was under Greek rule. The Jewish population of Libya, a part of the Sephardi-Maghrebi Jewish community, continued to populate the area continuously until modern times. During World War II, Libya's Jewish population was subjected to antisemitic laws by the Fascist Italian regime and deportations by both the Italian and German armies.

After the war, anti-Jewish violence caused many Jews to leave the country, principally for Israel, though significant numbers moved to Italy and North America. Under Colonel Muammar Gaddafi, who ruled the country from 1969 to 2011, the situation deteriorated further, eventually leading to the emigration of the remaining Jewish population. The last Jew in Libya, 80-year-old Rina Debach, left the country in 2003.

Ancient history

Ptolematic period The area of Libya was divided in classical times into three distinct geographical regions, Tripolitania, Cyrenaica and the Fezzan. Jewish migration was predominantly along the coastlines, and historically the vast majority of the Jewish population was concentrated in the western, Tripolitania province. Early Jewish settlement in Cyrenaica, a region with significant Greek influence in what is now northeast Libya, likely stemmed from their substantial presence in neighboring Ptolemaic Egypt. After Ptolemy I Soter's conquest of Judea, many Jews were initially taken as captives but were later freed, while others emigrated to Egypt voluntarily, attracted by economic opportunities and Ptolemy's tolerant policies. In 312 BCE, Ptolemy settled many Jews in Cyrenaica to strengthen his kingdom.Gilbert, Martin: In Ishmael's House, p. 2-3

The historical record provides only limited information on the development of Jewish communities in Cyrenaica during the Ptolemaic period. One notable figure from this time is Jason of Cyrene, who wrote a historical account of the Maccabean revolt during the second century BCE. This account was later summarized in 2 Maccabees. While Jason's work suggests advanced education and an interest in Jewish nationalistic causes, it is unclear whether his perspectives were representative of broader Cyrenaican Jewry. Nonetheless, his writings suggest there may have been some level of interaction between Judea and Cyrenaica during this period.

In 146 BCE inscriptions found at Benghazi and elsewhere in Libya, give details about wealthy, well established and organised Jewish communities.

Roman period During the Roman era, Jewish communities in Cyrenaica became more prominent, with inscriptions revealing their integration into civic life. By the early imperial period, Jews held various positions within the city administrations of Cyrene and other cities. This integration is reflected in inscriptions that document Jews serving in civic roles and acquiring citizenship.

There is evidence of Jews living in Benghazi from 13 BCE. They were considered citizens, but were ruled by a Jewish archon unlike the rest of the Jews in that area. Ein Targhuna, near Massah, is believed to have been a Jewish military settlement during the Roman period. The site features Jewish rock-cut tombs, a menorah carving, possibly belonging to Jewish troops relocated by Augustus.

Augustus granted Cyrene's Jewish population certain privileges through Flavius, the governor of the province. At the time, they maintained close contact with the Jews in Jerusalem. In 73 CE, during the First Jewish–Roman War in Judaea, there was also a revolt by the Jewish community in Cyrene led by Jonathan the Weaver, which was quickly suppressed by the governor Catullus. Jonathan was denounced to the governor of Pentapolis. In vengeance, the Romans killed him and many wealthy Jews in Cyrene. Several Libyan Jews from around this period are known today, such as Jason of Cyrene, whose work is the source of the Second Book of Maccabees, and Simon of Cyrene, who is believed to have carried the cross of Jesus as he was taken to his crucifixion.

The Diaspora Revolt of 115–117 CE saw Jewish communities in Cyrenaica, Egypt, and Cyprus rising in rebellion during Trajan's reign. This revolt had a messianic dimension, as one ancient source refers to Lukuas, the leader of the Jewish rebels in Libya, as "king," suggesting that the uprising evolved from an ethnic conflict into a nationalist movement with messianic aspirations for political independence. It is possible that the rebels in Libya, whose actions caused widespread destruction and included a raid into Egypt, were attempting to initiate a broader movement aimed at a large-scale return to Judea. Ancient sources depict the revolt as exceptionally brutal, with reports of mutilation and cannibalism; however, contemporary scholars often view these accounts as exaggerated for rhetorical effect. In Cyrene and its surroundings, the revolt inflicted extensive damage on civic infrastructure, temples, and roads, necessitating substantial reconstruction by Hadrian at the beginning of his reign. The revolt's suppression by Roman general Marcius Turbo resulted in widespread devastation and the near-total expulsion of Jews from Cyrenaica. While there may be some evidence of Jewish farmers in rural Marmarica by the end of the second century, a significant Jewish presence was not re-established in Cyrenaica until the 4th century.

According to Jewish tradition, after the Bar-Kokhba revolt of 132-135 AD, the Romans deported twelve boatloads of Jews from Judea to Cyrenaica. Approximately half a million Jews are thought to have already been living there at the time. Most lived in farming villages while those by the sea were often sailors. Many others were potters, stonemasons, weavers, and merchants.

In the region of Tripolitania, Jewish presence is also traced to antiquity. Chronicler Mordehai HaCohen (1856–1929) recorded a tradition that the community of Yafran began after Jerusalem's destruction in 70 CE, when 30,000 Jewish captives were reportedly sold to Bedouins in Yafran by Titus's generals.

Late Antiquity During the fourth and fifth centuries, Jewish communities re-emerged in Cyrenaica, likely composed of immigrants from Palestine and the re-established Jewish community in nearby Egypt.

Middle Ages

Al-Bakri, an Arab Andalusian geographer writing in the second half of the 10th century, mentions a Jewish population inhabiting the town of Jadu, in Tripolitania.

The Spaniards, who conquered Libya in 1510 and held it for a brief period, drove some of the Jews to the mountain areas of Gharian and Tajura. Others were taken as prisoners and tortured under the laws of the inquisition, whilst others were taken to Naples and sold as slaves.

Modern times Ottoman rule The sense of mistrust, resentment and hostility towards a minority, reflecting also economic and religious differences remained latent, aside from occasional explosions of violence. The practice of usury was the main cause of animosity. The standard interest rate for pledged monies was 60% per annum, which could reach as high as 90% for smaller amounts of the kind Arab hinterland borrowers depended on. General discontent spread during the final years of the Karamanli dynasty coinciding with a notable economic downturn, in what long remained a mere subsistence economy.

The return of Ottoman rule to Tripoli in 1835 brought about an improvement in both the legal and economic conditions for Jews in the area. In the wake of the Ottoman Tanzimat reforms, the Jewish community was courted, and with the appointment of Eliyahu Bekhor ben Raphael Joseph Ḥazzan as their Hakham Bashi (1872–1886), provided with lavish funding. The Jewish population witnessed a sharp rise in growth so that by 1911, well over a century after the ravages of the 1785 plague which decimated both communities, Jews, exclusive of those who were considered foreign immigrants (the wealthier Dutch, Italian, Austrian and Spanish Jewish traders), constituted 14,283 of the 523,716 natives of the Tripolitanian region. The growth of markets led to a trend towards urbanization and the growth of new settlements in both communities. The central Ottoman authorities were favourably disposed to the Jews, and earlier guarantees to the Jewish community were strengthened by an Imperial Decree in 1865 that accorded them an autonomy, and endowed local rabbis with the right to independently represent their community.

Established along the main trade routes, Libyan Jews assumed an important role in credit by loans and deferral of incumbent payments, and were so trusted that Arab women would allow Jewish commercial agents access to their homes, something denied to other Muslims. The small scattered hinterland Jewish communities were not beneficiaries of these general improvements.

Some structural vexations nonetheless remained, to create difficulties for these flourishing communities in the later 19th century: namely, a laxness in the application of Islamic law, often arbitrary, and the venality of local officials. A further issue was the expanding wealth gap opening up between resident foreign Jews and the poorer indigenous Jews. After 1861, pressure from European powers, duly informed of abuses by the Alliance Israélite Universelle (AIU), mitigated the impact of some abuses, and the growth of charities and schooling alleviated stress, though conducive to a certain fatalistic passiveness, which was considered to have traditionally marked these communities, whose ‘vegetative’ superstitiousness, and lifestyle in highly cramped and disease-ridden ghetto (hara) hovels, together with ignorance, was complained of by several AIU reports.

Overall, by the end of the 19th century, while economic conditions did improve both for the hinterland and richer Tripoli communities of Jews, conditions for the urban masses of Jews worsened, exacerbated by both a high birth-rate and the influx of Jews from the outlying territory, which also led to a deterioration of relations with Muslims. Complaints about usury by the latter were often associated with a perception that wealthy foreign Jews had undue influence over the government. As modernizing changes increased their pace, many Jews assumed a mediating role between the crumbling order institutional world and the emerging new society, and bore the brunt for the upheavals of change.

Sectors of the Muslim community itself, exposed to emergent trends in Europe, began to develop their own rudimentary form of nationalism, taking on board the anti-Semitism which tainted the latter. The government, though it did impose a special tax on those who did not do military service, opposed this drift in order to balance the pressure of European expansion, by recognizing the importance of developing the local economy where wealthy Jews played a significant role. A number of international incidents also contributed to local outbursts of xenophobia, like the French occupation of Tunisia and the Russo-Turkish War (1877–1878) The resulting bigotry occasioned riotous outbreaks which targeted Jews, who were increasingly viewed as allied to European interests.