When moderate liberal President Ignacio Comonfort was forced to resign by the Conservatives in 1858, Juárez, as head of the Supreme Court, assumed the presidency and the two governments competed. His succession was codified in the Constitution of 1857 but he survived in internal exile for a period during which he signed the McLane-Ocampo Treaty in 1859. He weathered the War of the Reform (1858–1860), a civil war between the Liberals and the Conservatives, and the French invasion (1861–1867), which was supported by Conservative monarchists. Never relinquishing office, although forced into exile to areas of Mexico not controlled by the French, Juárez tied Liberalism to Mexican nationalism. He asserted his leadership as the legitimate head of the Mexican state, rather than Emperor Maximilian, whom the French had installed.