Francisco de Almeida served as the viceroy to the Portuguese State of India from 1505 to 1509. Upon his successor taking over he sailed back to his homeland with a fleet of three ships – Garcia, Belèm and Santa Cruz. In late February he dropped anchor near the Cape of Good Hope to replenish water. De Almeida and his men then traded with Khoikhoi who lived in the area. By all accounts these initial trades were cordial and both sides were satisfied. The Khoikhoi received iron in exchange for cattle. This cordiality came to an end though when approximately 12 of the Portuguese sailors visited the Khoikhoi village and attempted to steal a number of cattle. The upset villagers then chased the sailors back to their ships. Upon reaching the safety of their ships the sailors begged Almeida to take revenge upon the villagers who had defended their cattle. Even though Almeida admitted that his men were likely to blame for what had occurred he led a party of 150 men armed with swords, lances and crossbows to enact an unwarranted revenge. When they reached the village the raiders seized a number of children and cattle. Approximately 170 Khoikhoi warriors fought back with stones and assegais. Using their cattle as shields they routed the raiders killing 64 of them including Almeida and 11 of his captains. This devastating defeat put pause to Portugal’s run of victories in Africa and Asia.
References

David Johnson, 2013. Imagining the Cape Colony: History, Literature, and the South African Nation. 1 Edition. Edinburgh University Press