The 4th Portuguese India Armada was assembled in 1502 on the order of King Manuel I of Portugal and placed under the command of D. Vasco da Gama. It was Gama's second trip to India. The fourth of some thirteen Portuguese India Armadas, it was designed as a punitive expedition, targeting Calicut, to avenge the travails of the 2nd Armada and the massacre of the Portuguese factory in 1500.
Along the way, in East Africa, the 4th Armada established a Portuguese factory in Mozambique, made contact and opened trade with the gold entrepot of Sofala and extorted tribute from Kilwa. Once in India, the armada set about attacking Calicut shipping and disrupting trade along much of the Malabar Coast. But the ruling Zamorin of Calicut refused to accede to Portuguese demands, arguing that the violent exactions of the armada exceeded any claims they might have for compensation. The 4th Armada left without bringing the Zamorin to terms and leaving matters unresolved. Before departing, the armada established a crown factory in Cannanore and left behind a small patrol under Vicente Sodré, the first permanent Portuguese fleet in the Indian Ocean.
The Second India Armada, commanded by Pedro Álvares Cabral, had arrived in Portugal in the summer of 1501 in a terrible shape. Ship and human losses were tremendous, its mission objectives failed. They had failed to establish a factory in Sofala, the outlet of the Monomatapa gold trade in East Africa, and, more worrisomely, opened hostilities with the city-state of Calicut (Calecute, Kozhikode), the principal commercial entrepôt of the Kerala spice trade and dominant city-state on the Malabar coast of India.