Uruguay was inhabited by the Charrúa people for approximately 4,000 years before the Portuguese established Colonia del Sacramento in 1680; Uruguay was colonized by Europeans relatively late compared with neighboring countries. Montevideo was founded as a military stronghold by the Spanish in the early 18th century, signifying the competing claims over the region. Uruguay won its independence between 1811 and 1828, following a four-way struggle between Spain, Portugal, and later Argentina and Brazil. It remained subject to foreign influence and intervention throughout the 19th century, with the military playing a recurring role in domestic politics, culminating in a 1973 coup, which established a civic-military dictatorship. The military government persecuted leftists, socialists, and political opponents, resulting in several deaths and numerous instances of torture by the military; the military relinquished power to a civilian government in 1985. Uruguay is today a democratic constitutional republic, with a president who serves as both head of state and head of government.