In 1564, Miguel López de Legazpi was commissioned by the viceroy of New Spain, Luís de Velasco, to explore the Maluku Islands where Magellan and Ruy López de Villalobos had landed in 1521 and 1543, respectively. The expedition was ordered by Philip II of Spain, after whom the Philippines had earlier been named by Villalobos. El Adelantado Legazpi established settlements in the East Indies and the Pacific Islands in 1565. He was the first governor-general of the "Spanish East Indies". After obtaining peace with various indigenous tribes, López de Legazpi made the Philippines the capital in 1571.