The Second Boer War was a military confrontation that spanned from 1899 to 1902 between the British Empire and the two self-governing Boer states, the South African Republic and the Orange Free State. This war was sparked by the discovery of gold in Boer territories and an influx of British miners who were denied political rights by the Boers. The war was fought in three phases: the first phase was a series of successful Boer offensives that besieged British towns such as Mafeking and Kimberley; the second phase was a British counter-offensive that broke the sieges and occupied the Boer capitals of Pretoria and Bloemfontein; and the third phase was a guerrilla war that lasted until the Boers surrendered under the terms of the Treaty of Vereeniging. The war resulted in the annexation of the Boer republics into the British Empire and the establishment of self-governing colonies in South Africa. The war also had significant consequences for the British military, as it exposed its weaknesses and prompted reforms in tactics, equipment, and organization. Many of these would later prove useful during World War I.
Britain's colonies participated in this conflict by sending volunteer forces (see: Australia in the Second Boer War).