Mexico's early history as a nation state was marked by political and socioeconomic upheaval. The Texas Revolution and the Mexican–American War in the mid 19th century led to huge territorial losses to the United States. Liberal reforms were enshrined in the Constitution of 1857, which sought to integrate indigenous communities and curtail the power of the church and the military. This triggered an internal war of Reform and intervention by France, in which conservatives installed Maximilian Habsburg as emperor against the Republican resistance led by Benito Juárez. The last decades of the 19th century were marked by the dictatorship of Porfirio Díaz, who sought to modernize Mexico and restore order. The ''Porfiriato'' era ended in 1910 with the decade-long Mexican civil war, which killed approximately 10% of the population and after which the victorious Constitutionalist faction drafted a new 1917 Constitution, which remains in effect to this day. The revolutionary generals ruled as a succession of presidents until the assassination of Alvaro Obregón in 1928. This led to the formation of the Institutional Revolutionary Party the following year, which governed Mexico until 2000.