Zanj (Arabic: , adj. ?, Zanj?; Persian: ?, romanized: Zangi; Turkish: Zencî) was a name used by medieval Muslim geographers to refer to both a certain portion of Southeast Africa (primarily the Swahili Coast) and to its Bantu inhabitants. This word is also the origin of the place-names Zanzibar ("coast of the Zanji") and the Sea of Zanj.
The latinization Zingium serves as an archaic name for the coastal area in modern Kenya and Tanzania in southern East Africa. The architecture of these commercial urban settlements are now a subject of study for urban planning. For centuries the coastal settlements were a source of ivory, gold, and slaves, from sections of the conquered hinterland, to the Indian Ocean world.
Geographers historically divided the eastern coast of Africa at large into several regions based on each region's respective inhabitants. Arab and Chinese sources referred to the general area that was located to the south of Al-Misr (Egypt), Al-Habasha (Abyssinia) and Barbara (Somalia) as Zanj.
Zanj (meaning the "country of the blacks"), also transliterated as Zenj or Zinj, was situated in the Southeast Africa vicinity and was inhabited by Bantu-speaking peoples called the Zanj. The core area of Zanj occupation stretched from the territory south of present-day Ras Kamboni to Pemba Island in Tanzania. South of Pemba lay Sofala in modern Mozambique, the northern boundary of which may have been Pangani. Beyond Sofala was the obscure realm of Waq-Waq, also in Mozambique. The 10th-century Arab historian and geographer Abu al-Hasan 'Al? al-Mas'?d? describes Sofala as the furthest limit of Zanj settlement, and mentions its king's title as Mfalme, a Bantu word.
The Zanj traded with Arabs, Persians and Indians, but according to some sources, only locally, since they possessed no ocean-going ships. According to other sources, the heavily Bantu Swahili peoples already had seafaring vessels with sailors and merchants trading with Arabia and Persia, and as far east as India and China. However, Zanj refers more to the state of religion than color or origin. The Swahili, a non-contemporary enthnonym, included both Zanj, non-believers, and the Umma, Islamic community. Since Arab and Persian identity is patrilineal, elite Swahili claimed, often fictionalized, prestigious Asian genealogy. Modern misconceptions of cultural fusion or Asian origins developed from the tendency of wealthy Swahili to claim Asian origins and the disproportionate 19th century importation of Omani elements to Zanzibari and Swahili society (standard Swahili is the Zanzibari dialect and thus includes far more Arabic loanwords than the other, older Swahili dialects. 
Prominent settlements of the Zanj coast included Malindi, Gedi, and Mombasa. By the late medieval period, the area included at least 37 substantial Swahili trading towns, many of them quite wealthy. However, these communities never consolidated into a single political entity (the "Zanj Empire" being a late 19th-century fiction).
While the urban ruling and commercial classes of these Swahili settlements included some Arab and Persian immigrants, the vast majority were African Muslims. Mythic origins from Persia or Arabia should not be taken literally, but rather as a widespread element of Islamic society to legitimate elite status. The Bantu peoples inhabited the coastal regions, and were organized only as family groups. The term shenzi, used on the East African coast and derived from the Swahili word zanji, referred in a derogatory way to anything associated with rural blacks. An example of this would be the colonial term shenzi dog, referring to a native dog. The name of a well-known dog breed, Basenji, means 'of the blacks'.
The Zanj were for centuries shipped as slaves by Arab traders to all the countries bordering the Indian Ocean. The Umayyad and Abbasid caliphs recruited many Zanj slaves as soldiers and, as early as 696 AD, we learn of slave revolts of the Zanj against their Arab masters in Iraq (see below). Ancient Chinese texts also mention ambassadors from Java presenting the Chinese emperor with two Seng Chi (Zanji) slaves as gifts, and Seng Chi slaves reaching China from the Hindu kingdom of Sri Vijaya in Java.
The sea off the south-eastern coast of Africa was known as the Sea of Zanj, and included the Mascarene islands and Madagascar. During the anti-apartheid struggle it was proposed that South Africa should assume the name Azania, to reflect ancient Zanj.
Arab descriptions of the Zanj peoples have been inconsistent. A negative view is exemplified in the following passage from Kitab al-Bad' wah-tarikh, by the medieval Arab writer al-Muqaddas?:
As for the Zanj, they are people of black color, flat noses, kinky hair, and little understanding or intelligence.
In 1331, the Arabic-speaking Berber explorer Ibn Battuta visited the Kilwa Sultanate in the Zanj, which was ruled by Sultan Hasan bin Sulayman's Yemeni dynasty. Battuta described the kingdom's Arab ruler as often making slave and booty raids on the local Zanj inhabitants, the latter of whom Battuta characterized as "jet-black in color, and with tattoo marks on their faces."
Kilwa is one of the most beautiful and well-constructed towns in the world. The whole of it is elegantly built. The roofs are built with mangrove pole. There is very much rain. The people are engaged in a holy war, for their country lies beside the pagan Zanj. Their chief qualities are devotion and piety: they follow the Shafi'i sect. When I arrived, the Sultan was Abu al-Muzaffar Hasan surnamed Abu al-Mawahib [loosely translated, "The Giver of Gifts"] ... on account of his numerous charitable gifts. He frequently makes raids into the Zanj country [neighboring mainland], attacks them and carries off booty, of which he reserves a fifth, using it in the manner prescribed by the Koran [Qur'an].
The Zanj Rebellion was a series of uprisings that took place between 869 and 883 AD near the city of Basra in present-day Iraq. Many Zanj were taken as slaves and were often used in strenuous agricultural work. In particular, Zanj slaves were used in labor-intensive plantations, harvesting crops such as sugarcane in the lower Mesopotamia basin of what is now southern Iraq. Harsh circumstances apparently provoked three rebellions in the late 7th and 9th centuries. What is now called the Zanj Rebellion was the largest of these.
Researcher M. A. Shaban states that the Zanj Rebellion was not a slave rebellion but rather an Arab rebellion supported by East African immigrants in Iraq:
It was not a slave revolt. It was a zanj, i.e. a Negro, revolt. To equate Negro with slave is a reflection of nineteenth-century racial theories; it could only apply to the American South before the Civil War...On the contrary, some of the people who were working in the salt marshes were among the first to fight against the revolt. Of course there were a few runaway slaves who joined the rebels, but this still does not make it a slave revolt. The vast majority of the rebels were Arabs of the Persian Gulf supported by free East Africans who had made their homes in the region.
ancient Arabic geography had quite a fixed pattern in listing the countries from the Red Sea to the Indian Ocean: These are al-Misr (Egypt) -- al-Muqurra (or other designations for Nubian kingdoms) -- Zanj (Azania, i.e. the country of the "blacks"). Correspondingly almost all these terms (or as I believe: all of them!) also appear in ancient and medieval Chinese geography.