This happened a few days before San Martin's Peruvian forces could arrive and occupy Guayaquil, with the intention of annexing Guayaquil to the rest of Audiencia of Quito (Ecuador) and to the future republic of Peru.