Growth in Egyptian and Persian shipping from the Red Sea and the Persian Gulf revitalized Indian Ocean trade, particularly after the Fatimid Caliphate relocated to Fustat (Cairo). Swahili agriculturalists built increasingly dense settlements to tap into trade, these forming the earliest Swahili city-states. The Venda-Shona Kingdoms of Mapungubwe and Zimbabwe in South Africa and Zimbabwe, respectively, became a major producer of gold around this same period. Economic, social, and religious power was increasingly vested in Kilwa, Tanzania's major medieval city-state. Kilwa controlled a number of smaller ports stretching down to modern-day Mozambique. Sofala became the major gold emporium and Kilwa grew rich off the trade, lying at the southern end of the Indian Ocean Monsoons. Kilwa's major rivals lay to the north, in modern-day Kenya, namely Mombasa and Malindi. Kilwa remained the major power in East Africa until the arrival of the Portuguese at the end of the 15th century.