However, the decentralized and unorganized tendencies of the captaincy colonies proved problematic, and in 1549 the Portuguese king restructured them into the Governorate General of Brazil in the city of Salvador, which became the capital of a single and centralized Portuguese colony in South America. In the first two centuries of colonization, Indigenous and European groups lived in constant war, establishing opportunistic alliances in order to gain advantages against each other. By the mid-16th century, cane sugar had become Brazil's most important export, and slaves purchased in Sub-Saharan Africa, in the slave market of Western Africa (not only those from Portuguese allies of their colonies in Angola and Mozambique), had become its largest import, to cope with plantations of sugarcane, due to increasing international demand for Brazilian sugar. Portuguese Brazil received more than 2.8 million slaves from Africa between the years of 1500 to 1800.