The Arabs asserted themselves first on the East Coast as traders and were in the main gladly met by people on the Coast and from the interior. Similarly, several waves of migration from Persia, notably in the 11th century, resulted in a fusion of culture and religion. But coastal settlements were always open to attack from people of the interior. Sometimes these attacks had been provoked by Swahili, like the Sultan of Kilwa, who under the banner of Holy War or jihad launched raids in search of cattle or slaves. Sometimes the settlement of Arabs led to friction as this oral history recounts:
"The origin of Kua was that foreign Arabs came, and that when they arrived they came to the people who owned the town of Kua. These people were Shirazi, who had come long ago from Persia, and the Arabs asked for a place to build in; and they were given a site.
The Arabs were given the north part of the first town here, which was called Mkokotoni. The Shirazi said to the Arabs: Let us join together, that is you build here, and we shall be here, and we shall be neighbours together...
After a short time, when the Arabs had made themselves masters, they began to act wrongly, and first of all they cut off the hand of the chief of the builder so that he should not go elsewhere. The builder found himself in abject poverty and thought with bitter resentment of his work.
Then the Arabs built a small prison cell under the Royal Palace and barred it up. Here the people suffered much trouble."
- History of Kua recited by Shaikh Mwinchande bin Juma, formerly Jumbe of Kua, to G.S.P. Freeman-Grenville in 1955.
From the 15th century onwards, people on the East African coast were under commercial and political pressure from the Portuguese, as well as traders and rulers from the East. Many Coastal kingdoms were bullied by the Portuguese into paying regular tribute to the Portuguese crown and giving trading concessions.
The King of Malindi submitted to the Portuguese early on; the King of Mombasa by contrast, refused, and Mombasa was turned into a fortified city under Portuguese control in 1599, when they built Fort Jesus.
In 1631 there was further rebellion against the Portuguese; the catholic priest, Father Prior, and the Chaplain of Fort Jesus were killed on command of the Sultan of Mombasa for refusing to become Muslims.
The East Coast of Africa was a complicated patchwork of power bases and alliances. Enemies could become friends overnight, concessions and compromises were made according to the rough and violent circumstances of the day.
For example, the Zimba people from the interior were regarded by the Portuguese priest Father Joao dos Santos in the 16th century with terror - he even referred to them as cannibals. He happily however described their alliance with the Portuguese in order to beat the Turks. This incident lead the Portuguese to behead the Sultan of Lamu ostensibly for helping the Turks.
In the 18th century the French surgeon, M. Morice became a dear and honoured friend of the Sultan of Kilwa who gave him land and exclusive buying rights in the slave trade.
From the 1780's the Sultans of Oman reasserted their control over the east coast, moving their capital to Zanzibar in 1840. The Omanis were opposed by the Swahili rulers of the mainland and Zanzibar.
A Swahili view of Arab-Swahili relations in the 19th century
"Few of us cared much about going to Oman, as the proud Omani ladies rather regarded Zanzibar women as uncivilised creatures?all the members of our family born in Oman thought themselves much better and of higher rank than any of their African relations. In their opinion we were somewhat like negroes?and our speaking any other language but Arabic, i.e. Kiswahili, was the greatest proof of barbarity in their eyes."
- Princess Salme, one of the daughters of Sultan Seyyid Said, quoted by Abdul Sheriff in Slaves, Spices and Ivory in Zanzibar.
In the 19th century, the east coast became the object of German imperial ambition. In 1885 Germany declared a protectorate over the mainland of Tanganyika, contracting out administration to a commercial company. A series of rebellions ensued throughout the next decade. As part of the same European 'scramble' for Africa, Britain declared Zanzibar a Protectorate seeking to rule indirectly through the Omani Arabs. Zanzibar's relationship with the mainland, on the one hand, and Arabia and Persia on the other, remained complex. The ties with the Persian Gulf and Arabia were finally severed in the 1964 revolution, resulting in the death and mass exodus of most of the old Arab ruling class.