The first Spaniard in what is now Uruguay was Juan Díaz de Solís, when he explored the Río de la Plata. His death at the hands of Indians set the stage for a two-century-long struggle after the western shore of Buenos Aires across the estuary was settled in 1580; Uruguay did not receive permanent settlements.
For a time some Jesuits attempted religious missions and faced opposition from the Charruas, the fierce tribe who occupied the area that became Uruguay. The native population was not subdued and was instead essentially eliminated by 1800. There were no permanent settlements by the Spaniards in the 17th century.
Into this vacuum came the Portuguese. Having been under Spanish rule between 1580 and 1640, and not formally independent until 1667, the Portuguese wanted to make up for lost time, especially in their largest colony of Brazil.
In 1688 the Portuguese began a colony called appropriately Colonia in what is now northern Uruguay. They based their claim on the Treaty of Tordesillas and the papal bull of 1494, which gave Portugal claim to Brazil.
The Portuguese argued that the territory was an extension of Brazil, specifically its province Rio Grande do Sol (the area around São Paulo) that resembled what is present-day Uruguay in terms of climate and topography.
The Spanish countered when they established Montevideo, the capital of Uruguay, on the eastern shore of Uruguay. Colonia was taken and retaken several times in the ensuing century as Spain and Portugal struggled over the territory between the Río de la Plata and the Uruguay River, which came to be called the Banda Oriental del Uruguay, on the eastern shore of Uruguay.
When the War of Independence began in 1810, a native of Uruguay, Artigas, took control of the independence movement of the Spanish provinces of the Plata region, such as Buenos Aires and Cordova (the heart of modern-day Argentina). With his power, he was able to propose a federal system of all of the Plata provinces, which included the autonomy of the Banda Oriental.
In 1816 the Portuguese, still in possession of Brazil, invaded the country on the pretext of trying to restore order. The people of the Banda, or Uruguay as the province came to be called, had become independent and resisted the Portuguese for four years until they were finally overcome.
By 1825 the Portuguese had withdrawn from Brazil, and Uruguay again assumed its independence and, with Argentine aid, obtained it after a war with Brazil formally ended by the Treaty of Montevideo in 1828.
This became reality in 1830 when a republic was established. Uruguay was aided by the turmoil existing in Brazil during the minority of Don Pedro before 1841. In addition, Brazil was struggling to overcome the secession attempt of Rio Grande do Sol.
After 1830 Argentina, under Juan Manuel de Rosas, dictator of Buenos Aires, was the threat to Uruguay as it sought to unite all the Plata provinces under its leadership. The country kept its integrity through the military and naval successes of Garibaldi at San Antonio and Cerro were successful in safeguarding the independence of Uruguay, ironically with some Brazilian aid in the 1840s.
From 1843 to 1851 allies of Rosas blockaded Montevideo, but by 1851 the siege had ended. By that date, Argentina and Brazil accepted the independent existence of Uruguay as long as the other party did not control it. Uruguay was the result of the balance of power between the two giants.