Modern Benghazi, on the Gulf of Sidra, lies a little southwest of the site of the ancient Greek city of Berenice, which was traditionally founded in 446 BCE, by a brother of the king of Cyrene. The new city was given the name Hesperides, in reference to the guardians of the mythic western paradise. The name may have also referred to green oases in low-lying areas in the nearby coastal plain. The city was refounded in the 3rd century BCE under the patronage of Berenice (Berenike), the daughter of Magas, king of Cyrene, and wife of Ptolemy III Euergetes, the ruler of Egypt. The city superseded Cyrene and Barca as the chief center of Cyrenaica after the 3rd century CE, but when the Arabs came, in 642-643, it had dwindled to an insignificant village among magnificent ruins.
The present name is derived from that of a pious benefactor of the city named Ghazi or "Sidi Ghazi," as the locals called him, who died about 1450. The city was renamed "Bani Ghazi".
In 1578 the Turks invaded Benghazi and it was ruled from Tripoli by the Karamanlis from 1711-1835, then passed under direct Ottoman rule until 1911. Under the Ottomans, Levantines, Maltese, Greekss and Jews formed the trading community, Turks, Arabs and Berbers formed a ruling castes, and Black Africans acted as labourers and domestics. The city was a port in the slave trade that supplied Islamic markets, until European consuls agitated for its suppression not long before before World War I. Under later Ottoman rule the squalor of Benghazi was oppressive; in 1911, the Encyclopaedia Britannica noted, it was the most impoverished of the Ottoman provinces. Benghazi had neither a paved road nor telegraph service, and the harbor was too silted to permit the access of shipping. Greek and Italian sponge fishermen worked its coastal waters. The city was a center for Islamist activists. In 1858 and again in 1874 Benghazi was devastated by bubonic plague.
Under the Italian colonial occupation, particularly under Mussolini, Cyrenaica suffered ruthless repression of the Libyan resistance. In 1931 the Libyan patriot Omar al-Mucktar was hanged at Souluk, a village just west of Benghazi, effectively ending Libyan resistance.
6-7 Sept 1995 saw clashes between police and militant Islamists in Beghazi. Thousands of arrests were made, including many Sudanese expatriates.