A few years after its foundation, Montevideo became the main city of the region north of the Río de la Plata and east of the Uruguay River, competing with Buenos Aires for dominance in maritime commerce. The importance of Montevideo as the main port of the Viceroyalty of the Río de la Plata brought it in confrontations with the city of Buenos Aires in various occasions, including several times when it was taken over to be used as a base to defend the eastern province of the Viceroyalty from Portuguese incursions.