He led the Afrikaners to victory in the First Boer War in 1881 and afterwards served as President of Transvaal from 1883 to 1899. His refusal to allow equal rights to non-Boer immigrants was one of the causes of the Second Boer War, during which Kruger was forced to flee the country. He died in exile in Switzerland.