During the struggle for independence, before Peru or Ecuador became independent nations, a few areas of the former Vice Royalty of New Granada - Guayaquil, Tumbez, and Jaén - declared themselves independent from Spain. A few months later, a part of the Peruvian liberation army of San Martin decided to occupy the independent cities of Tumbez and Jaén with the intention of using these towns as springboards to occupy the independent city of Guayaquil and then to liberate the rest of the Audiencia de Quito (Ecuador). It was common knowledge among the top officers of the liberation army from the south that their leader San Martin wished to liberate present-day Ecuador and add it to the future republic of Peru, since it had been part of the Inca Empire before the Spaniards conquered it.