Barred from direct contact with Europe by Spain’s mercantile bureaucracy, early Buenos Aires  had to survive on the resources of the sprawling pampas grasslands. The Querandí and other indigenous groups had subsisted on guanacos, rheas, and other game in addition to edible fruits and plants they gathered, but these resources were inadequate and culturally alien to the Spaniards.
The Mendoza expedition, though, had left behind horses that proliferated on the lush pastures, and the multiplication of escaped cattle from the Garay expedition soon transformed Buenos Aires’s backcountry into a fenceless feral-cattle ranch. The presence of horses and cattle, nearly free for the taking, resulted in the gaucho culture for which Argentina became famous. Durables were the primary product; perishable beef had little value.
Buenos Aires had no easily accessible markets, though, because hides were too low-value a product to ship to Spain via Lima and Panama; thus, there developed a vigorous contraband with British and Portuguese vessels in the secluded channels of the Paraná Delta . As this trade grew, Spain acknowledged Buenos Aires’s growing significance by making it capital, in 1776, of the newly created Virreinato del Río de la Plata (Viceroyalty of the River Plate). Reflecting its significance and the need to curb growing Portuguese influence, the viceroyalty even included the silver district of Potosí.
Buenos Aires’s population grew slowly at first, but by the time of the new viceroyalty it exceeded 24,000, and nearly doubled by the early 19th century. Open to European commerce, as Madrid loosened its control, the livestock economy expanded with the development of saladeros (meat-salting plants), giving value to a product that was almost worthless before.
Unlike the densely populated central-Andean area, Buenos Aires lacked an abundant labor force. The improving economy and growing population, which previously consisted of peninsular Spaniards, criollos (creoles, or American-born Spaniards), indígenas (Indians), and mestizos (the offspring of Spaniards and indígenas), soon included African slaves. Increasing political autonomy and economic success paved the way for the end of Spanish rule.
Appointed by the Spanish Crown, all major viceregal officials governed from Buenos Aires , and economic power was also concentrated there. Outside the capital, provincial bosses created their own power bases. When Napoleon invaded Spain in the early 19th century, the glue that held Spain’s colonies together began to dissolve, leading to Argentine independence in several steps.
Contributing to this tendency was a changing sense of identity. In the early generations, of course, people identified themselves as Spaniards, but over time criollos began to differentiate themselves from peninsulares (European-born Spaniards). It bears mention that while the mestizos and even the remaining indigenous population may have identified more closely with Argentina than with Spain, it was the criollo intelligentsia to whom independence had the greatest appeal.
South America’s independence movements commenced on the periphery, led by figures like Argentina’s José de San Martín, Venezuela’s Simón Bolívar, and Chile’s Bernardo O’Higgins, but their heroism rested on a broader base. In Buenos Aires, this base crystallized as opportunistic and unauthorized British forces, exploited Spain’s perceived weakness, occupied the city in 1806 and 1807.
As the shocked Viceroy Rafael de Sobremonte fled to Córdoba , city residents organized a covert resistance that, led by Frenchman Santiago de Liniers, dislodged the invaders. On the rationale that Spain’s legitimate government had fallen, the porteños of the capital chose Liniers as viceroy in an open cabildo (town meeting). The royalist Liniers, ironically, died at the hands of independence fighters during the Revolution of 1810.
Returning from Spain, San Martín led independence forces against the royalists, deployed from Perú, in what is now northwestern Argentina, and over the Andes into Chile. In 1816, in the city of Tucumán, delegates of the Provincias Unidas del Río de la Plata (United Provinces of the River Plate) issued a formal declaration of independence, but this was only a loose confederation that papered over differences between “Federalist” caudillos— provincial warlords intent on preserving their fiefdoms—and the cosmopolitan “Unitarists” of Buenos Aires .
The struggle between Federalists and Unitarists was slow to resolve itself; in the words of historian James Scobie, “It took seventy years for Argentina to coalesce as a political unit.” Even today, tensions between the provinces and the central government have not disappeared, but it took a Federalist to ensure Buenos Aires ’s supremacy.