The war ended in 1861 with victory by the Liberals , led by the Amerindian president Benito Juárez .
The liberal Benito Juárez won the war and became president afterwards .