In 1479, at the end of the Castilian War of Succession, which involved Portugal against the Catholic Monarchs, the Treaty of Alcáçovas was signed and a period of rapproachement between Spain and Portugal began. The text also settled several pending territorial issues between the two Crowns: the Canary Islands belonged by right to Castile; the Kingdom of Fez, the Azores and Madeira islands, Cape Verde, Guinea and the right of navegation beyond the Canaries, were recognized to Portugal.
For that reason, when being the Portuguese territories to the east of the Spanish ones, their explorations continued in that direction. This is how, bordering the African continent, the Portuguese explorers reached the Indian Ocean, where they formed colonies dedicated to expand their trade.
Portugal created small commercial bases in several points of Africa and the Indian Ocean, obtaining presence in the most important commercial routes of that tim, and began to charge those who passed through its colonies.
Portugal lost its power when, in 1581 in the middle of a dynasty crisis, the Spanish Crown came to the Portuguese throne. However, in 1668 Portuguese sovereignity over its territory was restored.
Portugal continued administrating colonies until 1970.