The Portuguese took advantage of the rivalry between the Zamorin and the King of Kochi allied with Kochi. When Francisco de Almeida was appointed as Viceroy of Portuguese India in 1505, his headquarters was established at Fort Kochi (Fort Emmanuel) rather than in Kozhikode.