Being sandwiched between South American powerhouses Brazil and Argentina has not always meant a certain or high-profile existence for Montevideo. It was in response to the growing influence of the Portuguese in Colonia del Sacramento that the Spanish first established a citadel in the sheltered port of Montevideo in 1726. It was also the rivalry between Uruguay's northern and southern neighbors that led to the country's independence in 1828 - it became a buffer zone between the two powers, thanks to a British-mediated treaty. The British, however, had commercial interests of their own, as Montevideo's port was superior to Buenos Aires' in many respects, making it a focal point for overseas shipping.
Most 19th-century Montevideanos had to contend with political and military threats from their neighbors and economic manipulation by Britain. From 1838 until 1851, the city suffered almost constant sieges from the Argentine dictator Rosas, who was determined to set up a small client state to Buenos Aires. After Rosas' fall in 1851, Montevideo's economy recovered and its port became the hub for an improving agricultural sector. Between 1860 and 1911, the British built a railroad network that greatly assisted Montevideo's growth and linked it with the campo (countryside).
Like Buenos Aires, the prospering city began to absorb a large number of European immigrants (mostly from Spain and Italy) in the early 20th century. By 1908, more than 30% of Montevideo's population was foreign-born, the source of the city's rich cultural diversity.
Economic stagnation and political decline in the mid-20th century saw Montevideo's middle-class prestige all but ended - the ensuing military dictatorship scarred the city. Many refugees from areas of rural poverty flooded into the city - mostly living in conventillos, large, older houses converted into multi-family slums in Ciudad Vieja (Old City).
A return to more democratic traditions, stronger trade ties with its South American neighbors and the rapid growth of urban population have lead to renewed agricultural expansion and optimism for prosperity.
Argentina's 2001 financial crisis hit the city - and the whole country - hard, and panic withdrawals from banks quickly drained reserves. Austere economic measures - often at the expense of domestic programs - have seen the country's reputation recover quickly in international markets.