The future capital of Costa Rica was established in 1737 as Villanueva de la Boca del Monte del Valle de Abra (New Village of the Mountain’s Mouth in the Open Valley), though the name was later changed to a more manageable San José in honor of Joseph, the town’s patron saint. Interestingly enough, the founding of San José was the result of an edict from the Catholic Church, which decreed that the populace must settle near a place of worship (attendance was down, times were bad, and churches were cheap to build).
For much of the colonial period, San José played second fiddle to the bigger and relatively more established Cartago. Following the surprise announcement in 1821 that Spain had abandoned its colonial holdings in Central America, Cartago and San José signed a series of empty-worded accords while secretly preparing for battle. On April 5, 1823, San José defeated Cartago at the Battle of Ochomongo, and subsequently declared itself capital. (Much to the chagrin of modern-day residents of Cartago, this rivalry still remains one-sided on the football field.)
Although San José generously offered to rotate capital status, bitterness ensued, and on September 26, 1835, Cartago, Heredia and Alajuela joined forces in an attempt to sack the city. In a siege that become known as La Guerra de la Liga (the War of the Leagues), San José defeated its attackers and retained its status as the capital. (Much to the chagrin also of modern-day residents of Heredia, this rivalry still remains one-sided on the football field, though Alajuela manages to hold its own.)
Recent years have been marked by a massive urban migration as Ticos (and increasingly Nicaraguans) move to the capital in search of increased economic opportunities. Unfortunately, this has resulted in the creation of shantytowns on the outskirts of the capital, and crime is increasingly becoming a way of life for many poverty-stricken inhabitants. Ticos are quick to point fingers at the Nicaraguans (as well as the Panamanians and Colombians) for causing to the degradation of their capital, and although these groups are certainly part of the problem, the total picture is much more complex.