Uruguay is a South American country whose official name is the Oriental Republic of Uruguay. It is bordered on the west and southwest by Argentina, and on the north and northeast by Brazil, and on the south by the Rio de la Plata and the Atlantic Ocean. Uruguay has a population of 3.51 million people, with 2 million living in the metropolitan area of Montevideo, the country's capital and largest city. It is the second-smallest country in South America, after Suriname, with an area of approximately 176,000 square kilometers. Before the Portuguese founded Colónia do Sacramento in 1680, Uruguay was occupied by the Charra people for approximately 4,000 years; Uruguay was colonized by Europeans relatively late in comparison to neighboring countries. The Spanish built Montevideo as a military fortress in the early 18th century, symbolizing the region's conflicting claims. Uruguay gained independence between 1811 and 1828, after a four-way conflict involving Portugal, Spain, Argentina, and Brazil. Throughout the 19th century, it was subject to international interference and invasion, with the military playing a prominent role in domestic politics. A series of economic crises brought an end to a democratic era that began in the early twentieth century and culminated in a coup in 1973 that created a civic-military dictatorship. Leftists, communists, and political rivals were imprisoned by the military government, which resulted in many deaths and several cases of torture before handing over power to a civilian government in 1985. Uruguay is now a federal parliamentary republic with a president who is both president and prime minister. Uruguay has a high-income economy and is ranked first in Latin America for democracy, stability, low corruption perceptions, and e-government, as well as first in South America for press freedom, middle-class size, and prosperity. Uruguay contributes more forces to UN peacekeeping operations than any other nation on a per-capita basis. In the Global Terrorism Index, it is the lowest-ranking South American country, and it ranks second on the continent in terms of economic freedom, income equality, per-capita income, and FDI inflows. In terms of the Human Development Index, GDP growth, innovation, and infrastructure, Uruguay is the continent's third-best nation. Uruguay is known as one of Latin America's most socially egalitarian nations. It scores well on international indices of personal freedom, equality, and inclusion, as well as acceptance of the LGBT community. Cannabis has been legalized in the country, as has same-sex marriage and abortion. Uruguay is a founding member of the United Nations, the Organization of American States (OAS), Mercosur, and the Non-Aligned Movement (NAM).