The second millennium
On Unguja, one of the earliest remaining examples of permanent settlement from persia is a mosque at kizimkazi, on the southern part of the island. It contains an inscription dated ah500 (anno hegirae), which corresponds to the christian year ad1107, making this the oldest-known Islamic building on the east African coast. From the end of the 12th century, Omani immigrants also settled in Pemba. At around the same time, the settlement that was to become Zanzibar Town also began to grow.
As the trade between Africa, Arabia and the rest of the Indian Ocean continued to expand, Zanzibar became an increasingly powerful and important commercial centre. Major imports included cotton cloth, porcelain and copper from Dabhol, a port on the west coast of India, and exports included iron from Sofala (in present-day Mozambique). By the 13th century, Zanzibar was minting its own coins, and stone buildings were starting to replace more basic mud dwellings. In 1295, the Venetian traveller Marco Polo wrote of Zanzibar: 'The people have a king … elephants in plenty … and whales in large numbers', although he never visited the island. Other writers of the time noted that the kings and queens of Zanzibar and Pemba dressed in fine silks and cottons, wore gold jewellery, and lived in stone houses decorated with Persian carpets and Chinese porcelain.
Many Chinese imports had come to Zanzibar via India, but in the early 15th century the ports on the coast of east Africa were trading directly with China. Gold, ivory and rhino-horn were transported to the East, as well as a small number of slaves. In 1414, a dhow from the city of Malindi (in present-day Kenya) carried a giraffe to China, as a present for the emperor. The trade came to an abrupt end in 1443 when the new Ming emperor banned Chinese merchants from going abroad, but the demand for ivory remained, supplied by Arab dhows via markets in India.
By the mid 15th century the islands of Zanzibar, along with Mombasa, Malindi, Lamu and Kilwa, formed a chain of thriving Swahili Islamic city states, each with its own sultan, spread along the east African coast. These cities had close trading links with Arabia, Persia, India and southeast Asia. Commerce between Africa and the Indian Ocean had become very profitable, and it seems that the sultans of Zanzibar and the other city states were more than happy for their territories to remain as gateways or conduits for it. At the end of the 15th century, though, the situation was severely disrupted by the arrival of the Portuguese on the coast of east Africa.