When Portuguese ships rounded southern Africa at the end of the fifteenth century, they entered an ocean that already had rules, routes and great ports. They had few goods the coast wanted. What they had was artillery mounted on ships, and a plan to take by force a share of a trade they could not win by bargaining.
Arrival and force
Vasco da Gama's fleet reached the coast in 1498, met hostility at Mombasa and found a friend in Mombasa's rival, Malindi. The fleets that followed came to conquer. In 1505 a fleet under Francisco de Almeida attacked Kilwa and Mombasa, and the Portuguese built forts at Kilwa and at Sofala in the hope of controlling the gold trade. Malindi became Portugal's main ally on the coast, and its rulers profited from the alliance at the expense of their neighbors.
Portugal's aim was to make Asian and African merchants trade on Portuguese terms: to pay duties at Portuguese forts and to carry passes bought from Portuguese officials. The towns paid tribute, and some were attacked again and again. Mombasa was sacked in 1505, in 1528 and in 1589. Each attack left the town poorer, and each time its people rebuilt.
Why the gold slipped away
The Portuguese soon found that holding a port did not mean holding a trade. Gold from the interior simply traveled by other routes, through smaller harbors and river mouths beyond their reach. The Portuguese abandoned their fort at Kilwa in 1512, only seven years after building it. Portuguese captains also traded privately on their own account, often against royal orders, which further weakened the crown's control. Later they pushed up the Zambezi River, founding posts at Sena and Tete to reach the gold fields directly.
Overall, the coast's trade did not vanish, but it was disrupted. Some towns declined, Kilwa among them; others, especially in the north, such as Pate, adapted and grew. Swahili merchants kept trading with India and Arabia, sometimes with Portuguese passes and sometimes without them.
A rival empire
Portugal was not the only power with ambitions here. The Ottoman Empire, which controlled the Red Sea, sent a corsair captain south. The Ottoman captain Mir Ali Bey was welcomed by several Swahili towns in 1585, which saw him as a liberator from Portuguese tribute. He returned in 1588 to 1589 and fortified Mombasa, but a Portuguese fleet arrived, and at the same moment a raiding army from the mainland, known in Portuguese sources as the Zimba, attacked the town. Mir Ali was captured and Mombasa was sacked once more.
The lesson the Portuguese drew was that they needed a permanent stronghold. Fort Jesus in Mombasa was designed by the Italian military architect Giovanni Battista Cairati and begun in 1593. Its angled bastions, built to deflect cannon fire, followed the latest European designs. The Portuguese moved their regional captain from Malindi to Mombasa, and Malindi's ruler was installed there as sultan.
The sultan who turned
The most dramatic episode came from inside the Portuguese system. Yusuf bin Hasan, a son of Mombasa's sultan, was sent as a boy to Goa, the Portuguese capital in India, where he was educated and baptized as Dom Jerónimo Chingulia. In 1626 the Portuguese installed him as sultan of Mombasa. Five years later, in 1631 Yusuf bin Hasan killed the Portuguese captain and garrison of Mombasa and returned to Islam. The Portuguese sent a fleet, and he abandoned the town and spent his last years raiding along the coast and in the Red Sea.
Oman takes the coast
The end came from the north. In 1650 the Yaruba imams of Oman drove the Portuguese from Muscat, and Swahili towns, Pate above all, invited the Omanis to help them. After a long struggle, Omani forces took Fort Jesus in December 1698 after a siege of almost three years, begun in March 1696. Disease killed most of the defenders long before the walls fell. The Portuguese briefly regained Mombasa in 1728 to 1729, but north of Cape Delgado their rule was finished. They kept Mozambique.
Worked example: judging Yusuf bin Hasan
How should we understand Yusuf bin Hasan? Portuguese writers called him a traitor and an apostate. Later nationalists sometimes treated him as an early hero of resistance. Both labels fit some of the evidence and miss some.
Consider his position. He was raised among the Portuguese, owed his throne to them and took their faith. Yet the sources suggest that the Portuguese captain of the fort treated him with contempt, and that he discovered his father had been killed in circumstances that implicated the Portuguese. He was a ruler with two upbringings, two faiths and no secure place in either world.
The useful question is not "hero or traitor?" but "what choices did someone in his position have?" A colonial system that recruited local rulers by educating and converting them also created people who understood it from the inside and could turn against it. That pattern would repeat across the colonial world for centuries.
