His refusal to repay Mexico’s foreign debts led to the occupation of Mexico by Napoleon III and the establishment of Maximilian as emperor of Mexico in 1864. The withdrawal of the occupying French forces in 1867 prompted the execution of Maximilian and the rehabilitation of Juárez in the same year.