On the Libyan coast, in the heart of the region of Tripolitania, a city arose that was known in ancient times as Oea, one of three cities that gave the region its name, "Tripolis," meaning "the three cities."

The city's importance, however, did not end with its pre-Islamic history. A new phase began with the Islamic conquest in the first century AH/seventh century CE, when Muslim armies reached the Libyan coast during the caliphate of Umar ibn al-Khattab, may God be pleased with him.

Its coastal position was of great importance. It lies on the Mediterranean on one side and, on the other, is linked to routes running inland toward the desert. It was therefore not merely a coastal city but a point of contact between the Mediterranean and the interior of Africa.

Islam Enters Tripoli, and the City Becomes a Base

The first Islamic conquest did not mark the end of the struggle over the region. Political control of Tripoli continued to shift with the changing balance of power in the Maghrib and Ifriqiya.

The city came under a succession of different Islamic authorities and states. It fell within the orbit of the Aghlabids, then the Fatimids, then the Almoravids and the Almohads, and after them the Hafsids, before undergoing periods of conflict and European and Mediterranean rivalry.

Tripoli's importance is evident in the Aghlabid period, when it became part of Ifriqiya's political sphere and remained tied to Kairouan and the centres of government in Tunisia. Its allegiance later passed to the Fatimids after the founding of their state in 296 AH/909 CE. Historical sources note that Tripoli remained within the Fatimid sphere until the sixth century AH.

This repeated connection with Ifriqiya made Tripoli part of a network of Islamic cities whose political boundaries were not fixed but shifted with the states that ruled the Islamic Maghrib.

Between the Almoravids, Almohads and Hafsids

In the sixth century AH/twelfth century CE, the Islamic Maghrib entered a new phase with the rise of the Almohads, and Tripoli's presence in the network of political powers that succeeded one another in the region continued.

After the collapse of the Almohad state in the seventh century AH/thirteenth century CE, Tripoli came under the Hafsid sphere and became close to the seat of government in Tunisia.

Studies of the city's history reveal the importance of the Hafsid period in Tripoli's political and urban development, particularly from 625 AH/1227 CE, when the Hafsid state in Ifriqiya began to inherit the Almohads' influence in the region.

Tripoli was part of a wide economic and cultural network that extended along the coast, linking cities with ports, markets and desert routes.

A City That Lived on Trade

Trade was one of the key keys to understanding Tripoli's history. Its port gave it direct access to the Mediterranean, while its geographical position allowed access to caravan routes heading south into the desert and from there to the regions of the African Sudan.

Recent documents concerning the city's heritage indicate that the port of Tripoli was a fundamental element of its connection to trans-Saharan trade networks and to the Mediterranean basin, and that this commercial role was reflected in its urban form and culture.

Markets, caravanserais, baths and workshops emerged from this, and the city's core became a space where commerce intertwined with worship and social life.

The Old City: Where Architecture Became a Record of History

One of the most distinctive features of Tripoli is that its Islamic history cannot be read from a single book; it can be read within its alleys and mosques.

The old city contains a large number of mosques, zawiyas, madrasas and kuttabs, among them the Jami al-Naqa, Jami Dragut, Jami Shayeb al-Ayn, Jami Sidi Salim, Jami Mahmud Khazin Dar, Jami Qarji, and the Jami Ahmed Pasha al-Qaramanli, alongside a number of zawiyas and educational institutions. Bodies responsible for the city's heritage count dozens of religious and educational structures within the old city.

This architectural density shows that the mosque in Tripoli was not merely a building for prayer but part of an integrated system that included education, the judiciary, endowments, markets and social relations.

Ahmad Pasha al-Qaramanli Mosque, built in 1149 AH/1737 CE, and one of the most prominent symbols of Islamic architecture in the old city of Tripoli.

Dragut Pasha: The Beginning of a New Ottoman Phase

In the tenth century AH/sixteenth century CE, Tripoli entered an Ottoman phase after the end of the Spanish presence there and the city's return to Ottoman rule in 958 AH/1551 CE.

Among the most prominent monuments of this phase is the Dragut Pasha Mosque, completed around 963 AH/1556 CE, which became one of the major landmarks of Ottoman architecture in the city.

Dragut Pasha Mosque

This period was also linked to the development of a network of mosques, madrasas and markets, and Tripoli became an important Ottoman centre on the southern Mediterranean coast.

Subsequently, a number of religious structures bearing clear Ottoman features appeared in the city, the most notable of which is the Mosque and Madrasa of Uthman Pasha al-Saqzli, dating to 1654 CE.

Ahmed Pasha al-Qaramanli: When Tripoli Became a Quasi-Independent Seat of Power

Tripoli entered an entirely new phase with the rise of Ahmed Pasha al-Qaramanli in 1123 AH/1711 CE.

During his rule, Tripoli became a politically and economically active centre, and building activity in the city flourished.

Among the best-known monuments of this period is the Ahmed Pasha al-Qaramanli Mosque, built in 1149 AH/1737 CE, which became the state mosque and a symbol of the Qaramanli era, alongside the madrasas, endowments, markets and related structures.

Yusuf Pasha al-Qaramanli, who ruled after Ahmed Pasha, is associated with a period of significant economic and political expansion in Tripoli's history, particularly during the early decades of the thirteenth century AH/nineteenth century CE.

Tripoli and Learning: The Mosque, the Madrasa and the Zawiyas

Tripoli was not only a city of government and trade. As the city grew, a network of madrasas, mosques and zawiyas took shape there, and circles of learning emerged connected with Maliki jurisprudence, the Islamic sciences and language.

Studies of Tripoli's medieval history mention the Mustansiriya Madrasa, whose founding dates to the seventh century AH/thirteenth century CE, along with other educational institutions that appeared in the Hafsid and Ottoman periods.

In the old city, the mosque remained linked to the madrasa, the market and the neighbourhood. The study of Tripoli's urban fabric therefore reveals how the Islamic city took shape around interlocking functions rather than around palaces alone.

Tripoli Between the Mediterranean and the Desert

Tripoli's historical distinctiveness may lie in its intermediary location. It is neither an inland city like Kairouan, nor a Mediterranean Andalusian city like Cordoba, nor a vast imperial capital like Baghdad. It instead performed a different role: a maritime gateway to the desert and an African window onto the Mediterranean.

Through its port, markets and caravans, goods, news and people moved, and scholars, merchants and pilgrims travelled between North Africa and its interior.

For this reason the city remained present on the maps of the Islamic Maghrib even as the states that governed it changed.

What Remains of Tripoli?

The old city remains the most important living record of this history. Within it, Ottoman mosques, markets, caravanserais, baths, zawiyas and traditional houses stand side by side, alongside older remains from the pre-Islamic era, such as the Arch of Marcus Aurelius.

Libya's Ministry of Tourism and Traditional Industries affirms that the old city contains a wide range of monuments combining Mediterranean, African and Eastern architecture, among them the minarets of the Jami Qarji and the Pasha Mosque, the historic markets and the baths.

Thus Tripoli remains a city whose historical layers can be read in its stone: ancient Oea, then Islamic Tripoli, then the Ottoman city, then the Qaramanli capital.