The first European settlement in South Africa was founded at the Cape of Good Hope in 1652, and thereafter administered as part of the Dutch Cape Colony.

The Cape was governed by the Dutch East India Company until its bankruptcy in the late 1700s, and thereafter directly by the Netherlands.

The Boers were itinerant farmers who lived on the colony's frontiers, seeking better pastures for their livestock. Many Boers who were dissatisfied with aspects of British administration, in particular with Britain's abolition of slavery on 1 December 1834, elected to migrate away from British rule in what became known as the Great Trek.

Around 15,000 trekking Boers departed the Cape Colony and followed the eastern coast towards Natal. After Britain annexed Natal in 1843, they journeyed further northwards into South Africa's vast eastern interior.

There they established two independent Boer republics: the South African Republic (1852; also known as the Transvaal Republic).

There they established two independent Boer republics: The Orange Free State (1854).

In 1866 diamonds were discovered at Kimberley, prompting a diamond rush and a massive influx of foreigners to the borders of the Orange Free State.

In 1868, Britain annexed Basutoland in the Drakensberg Mountains following an appeal from Moshesh, the leader of a mixed group of African refugees from the Zulu wars, who sought British protection against the Boers.

Britain recognized the two Boer republics in 1852 and 1854, but attempted British annexation of the Transvaal in 1877 led to the First Boer War in 1880–81. After Britain suffered defeats, particularly at the Battle of Majuba Hill (1881), the independence of the two republics was restored subject to certain conditions; relations, however, remained uneasy.

Britain attempted to annex first the South African Republic in 1880, and then, in 1899, both the South African Republic and the Orange Free State.

In the 1880s, Bechuanaland (modern Botswana, located north of the Orange River) became the object of a dispute between the Germans to the west, the Boers to the east, and Britain's Cape Colony to the south.

The conflict is commonly referred to as the Boer War, since the First Boer War (December 1880 to March 1881) was a much smaller conflict. "Boer" (meaning farmer) is the common term for Afrikaans-speaking white South Africans descended from the Dutch East India Company's original settlers at the Cape of Good Hope. It is also known as the (Second) Anglo-Boer War among some South Africans. In Afrikaans it may be called the Anglo-Boereoorlog ("Anglo-Boer War"), Tweede Boereoorlog ("Second Boer War"), Tweede Vryheidsoorlog ("Second Freedom War") or Engelse oorlog ("English War").

Although Bechuanaland had no economic value, the "Missionaries Road" passed through it towards territory farther north. After the Germans annexed Damaraland and Namaqualand (modern Namibia) in 1884, Britain annexed Bechuanaland in 1885.

Then in 1886, gold was discovered in the Witwatersrand area of the South African Republic. Gold made the Transvaal the richest nation in southern Africa; however, the country had neither the manpower nor the industrial base to develop the resource on its own.

In 1886, when a big gold field was discovered at an outcrop on a large ridge some 69 km (43 mi) south of the Boer capital at Pretoria, it reignited British imperial interests. The ridge, known locally as the "Witwatersrand" (white water ridge, a watershed) contained the world's largest deposit of gold-bearing ore.

British imperial interests were alarmed when in 1894–95 Kruger proposed building a railway through Portuguese East Africa to Delagoa Bay, bypassing British-controlled ports in Natal and Cape Town and avoiding British tariffs. Paul Kruger: was one of the dominant political and military figures in 19th-century South Africa, and President of the South African Republic (or Transvaal) from 1883 to 1900.

President Paul Kruger re-equipped the Transvaal army, importing 37,000 of the latest Mauser Model 1895 rifles, and some 40 to 50 million rounds of ammunition.

In 1895, a plan was hatched with the connivance of the Cape Prime Minister Cecil Rhodes and Johannesburg gold magnate Alfred Beit to take Johannesburg, ending the control of the Transvaal government. A column of 600 armed men (mainly made up of his Rhodesian and Bechuanaland British South Africa Policemen) was led by Dr. Leander Starr Jameson (the Administrator in Rhodesia of the British South Africa Company (or Chartered Company) of which Cecil Rhodes was the chairman) over the border from Bechuanaland towards Johannesburg.

The plan was to make a three-day dash to Johannesburg and trigger an uprising by the primarily British expatriate workers (uitlanders) organized by the Reform Committee before the Boer commandos could mobilize. The Transvaal authorities had advance warning of the Jameson Raid and tracked it from the moment it crossed the border. Four days later, the weary and dispirited column was surrounded near Krugersdorp within sight of Johannesburg. After a brief skirmish in which the column lost 65 killed and wounded—while the Boers lost but one man—Jameson's men surrendered and were arrested by the Boers.

The Boer government handed their prisoners over to the British for trial. Jameson was tried in England for leading the raid where the British press and London society inflamed by anti-Boer and anti-German feeling and in a frenzy of jingoism, lionized Jameson and treated him as a hero. Although sentenced to 15 months imprisonment (which he served in Holloway), Jameson was later rewarded by being named Prime Minister of the Cape Colony (1904–08) and ultimately anointed as one of the founders of the Union of South Africa.

The botched raid resulted in repercussions throughout southern Africa and in Europe. In Rhodesia, the departure of so many policemen enabled the Matabele and Mashona peoples to rise up against the Chartered Company, and the rebellion, known as the Second Matabele War, was suppressed only at great cost.

The war had three phases. In the first phase, the Boers mounted preemptive strikes into British-held territory in Natal and the Cape Colony, besieging the British garrisons of Ladysmith, Mafeking, and Kimberley. The Boers then won a series of tactical victories at Colenso, Magersfontein, and Spion Kop.

The June 1899 negotiations in Bloemfontein failed, and in September 1899 British Colonial Secretary Joseph Chamberlain demanded full voting rights and representation for the uitlanders residing in the Transvaal.

The best modern European artillery was also purchased. By October 1899 the Transvaal State Artillery had 73 heavy guns, including four 155 mm Creusot fortress guns and 25 37 mm Maxim Nordenfeldt guns. The Transvaal army had been transformed; approximately 25,000 men equipped with modern rifles and artillery could mobilise within two weeks. President Kruger's victory in the Jameson Raid incident did nothing to resolve the fundamental problem of finding a formula to conciliate the uitlanders, without surrendering the independence of the Transvaal.

Paul Kruger, the President of the South African Republic, issued an ultimatum on 9 October 1899, giving the British government 48 hours to withdraw all their troops from the borders of both the Transvaal and the Orange Free State, albeit Kruger had ordered Commandos to the Natal border in early September and Britain only had troops in garrison towns far from the border, failing which the Transvaal, allied to the Orange Free State, would declare war on the British government.

War was declared on 11 October 1899 with a Boer offensive into the British-held Natal and Cape Colony areas. The Boers had about 33,000 soldiers, and decisively outnumbered the British, who could move only 13,000 troops to the front line.

The Boers struck first on 12 October at the Battle of Kraaipan, an attack that heralded the invasion of the Cape Colony and Colony of Natal between October 1899 and January 1900.

Meanwhile, to the north-west at Mafeking, on the border with Transvaal, Colonel Robert Baden-Powell had raised two regiments of local forces amounting to about 1,200 men in order to attack and create diversions if things further south went amiss. Mafeking, being a railway junction, provided good supply facilities and was the obvious place for Baden-Powell to fortify in readiness for such attacks. However, instead of being the aggressor Baden-Powell and Mafeking were forced to defend when 6,000 Boer, commanded by Piet Cronjé, attempted a determined assault on the town. But this quickly subsided into a desultory affair with the Boers prepared to starve the stronghold into submission, and so, on 13 October, began the 217-day Siege of Mafeking.

Lastly, over 360 kilometres (220 mi) to the south of Mafeking lay the diamond mining city of Kimberley, which was also subjected to a siege. Although not militarily significant, it nonetheless represented an enclave of British imperialism on the borders of the Orange Free State and was hence an important Boer objective. The Siege of Kimberley took place during the Second Boer War at Kimberley, Cape Colony (present-day South Africa), when Boer forces from the Orange Free State and the Transvaal besieged the diamond mining town. The Boers moved quickly to try to capture the area when war broke out between the British and the two Boer republics in October 1899.

Boer guns began shelling the British camp from the summit of Talana Hill at dawn on 20 October. Penn Symons immediately counter-attacked: his infantry drove the Boers from the hill, for the loss of 446 British casualties, including Penn Symons.

The Battle of Elandslaagte was a battle of the Second Boer War, and one of the few clear-cut tactical victories won by the British during the conflict. However, the British force retreated afterward, throwing away their advantage.

As Boers surrounded Ladysmith and opened fire on the town with siege guns, White ordered a major sortie against their artillery positions. The result was a disaster, with 140 men killed and over 1,000 captured. The Siege of Ladysmith began, and was to last several months. The Siege of Ladysmith was a protracted engagement in the Second Boer War, taking place between 2 November 1899 and 28 February 1900 at Ladysmith, Natal.

The Battle of Belmont was an engagement of the Second Boer War on 23 November 1899, where the British under Lord Methuen assaulted a Boer position on Belmont kopje. Methuen's three brigades were on their way to raise the Boer siege of Kimberley. A Boer force of about 2,000 men had entrenched on the range of Belmont kopje to delay their advance. Methuen sent the Guards Brigade on a night march to outflank the Boers, but due to faulty maps the Grenadier Guards found themselves in front of the Boer position instead.

The Battle of Modder River (known in Afrikaans as Slag van die Twee Riviere, which translates as "Battle of the two rivers") was an engagement in the Boer War, fought at Muddy River, on 28 November 1899. A British column under Lord Methuen, that was attempting to relieve the besieged town of Kimberley, forced Boers under General Piet Cronjé to retreat to Magersfontein, but suffered heavy casualties themselves.

On 10 December, General Gatacre tried to recapture Stormberg railway junction about 80 kilometres (50 mi) south of the Orange River. Gatacre's attack was marked by administrative and tactical blunders and the Battle of Stormberg ended in a British defeat, with 135 killed and wounded and two guns and over 600 troops captured.

The middle of December was disastrous for the British Army. In a period known as Black Week (10–15 December 1899), the British suffered defeats on each of the three fronts.

Battle of Magersfontein was fought on 11 December 1899, at Magersfontein near Kimberley, South Africa, on the borders of the Cape Colony and the independent republic of the Orange Free State. British forces under Lieutenant General Lord Methuen were advancing north along the railway line from the Cape in order to relieve the Siege of Kimberley, but their path was blocked at Magersfontein by a Boer force that was entrenched in the surrounding hills. The British had already fought a series of battles with the Boers, most recently at Modder River, where the advance was temporarily halted. Lord Methuen failed to perform adequate reconnaissance in preparation for the impending battle, and was unaware that Boer Vecht-generaal (Combat General) De la Rey had entrenched his forces at the foot of the hills rather than the forward slopes as was the accepted practice. This allowed the Boers to survive the initial British artillery bombardment; when the British troops failed to deploy from a compact formation during their advance, the defenders were able to inflict heavy casualties. The Highland Brigade suffered the worst casualties, while on the Boer side, the Scandinavian Corps was destroyed. The Boers attained a tactical victory and succeeded in holding the British in their advance on Kimberley. The battle was the second of three battles during what became known as the Black Week of the Second Boer War. Following their defeat, the British delayed at the Modder River for another two months while reinforcements were brought forward. General Lord Roberts was appointed Commander in Chief of the British forces in South Africa and moved to take personal command of this front. He subsequently lifted the Siege of Kimberley and forced Cronje to surrender at the Battle of Paardeberg.

In the second phase, after the number of British troops was greatly increased under the command of Lord Roberts, the British launched another offensive in 1900 to relieve the sieges, this time achieving success. After Natal and the Cape Colony were secure, the British army was able to invade the Transvaal, and the republic's capital, Pretoria, was ultimately captured in June 1900.

The British government took these defeats badly and with the sieges still continuing was compelled to send two more divisions plus large numbers of colonial volunteers. By January 1900 this would become the largest force Britain had ever sent overseas, amounting to some 180,000 men with further reinforcements being sought.

The Battle of Spion Kop was fought about 38 km (24 mi) west-south-west of Ladysmith on the hilltop of Spioenkop along the Tugela River, Natal in South Africa from 23–24 January 1900. It was fought between the South African Republic and the Orange Free State on the one hand and British forces during the Second Boer War campaign to relieve Ladysmith. It resulted in a Boer victory. The battle, collectively with its location at a hill, has gone down in British football lore as the namesake of a common British term for single-tier terraces and/or stands at football stadia.

British troops captured the summit by surprise during the early hours of 24 January 1900, but as the early morning fog lifted they realised too late that they were overlooked by Boer gun emplacements on the surrounding hills. The result was 350 men killed and nearly 1,000 wounded and a retreat across the Tugela River into British territory. There were nearly 300 Boer casualties.

Roberts launched his main attack on 10 February 1900 and although hampered by a long supply route, managed to outflank the Boers defending Magersfontein. Field Marshal Frederick Sleigh Roberts, 1st Earl Roberts was a British Victorian era general who became one of the most successful British military commanders of his time. Born in India to an Anglo-Irish family, Roberts joined the East India Company Army and served as a young officer in the Indian Rebellion during which he won a Victoria Cross for gallantry. He was then transferred to the British Army and fought in the Expedition to Abyssinia and the Second Anglo-Afghan War, in which his exploits earned him widespread fame. Roberts would go on to serve as the Commander-in-Chief, India before leading British Forces to success in the Second Boer War. He also became the last Commander-in-Chief of the Forces before the post was abolished in 1904.

On 14 February, a cavalry division under Major General John French launched a major attack to relieve Kimberley. Although encountering severe fire, a massed cavalry charge split the Boer defenses on 15 February, opening the way for French to enter Kimberley that evening, ending its 124 days' siege.

In Natal, the Battle of the Tugela Heights, which started on 14 February was Buller's fourth attempt to relieve Ladysmith. The losses Buller's troops had sustained convinced Buller to adopt Boer tactics "in the firing line—to advance in small rushes, covered by rifle fire from behind; to use the tactical support of artillery; and above all, to use the ground, making rock and earth work for them as it did for the enemy." Despite reinforcements his progress was painfully slow against stiff opposition.

On 17 February, a pincer movement involving both French's cavalry and the main British force attempted to take the entrenched position, but the frontal attacks were uncoordinated and so were easily repulsed by the Boers. Finally, Roberts resorted to bombarding Cronjé into submission, but it took a further ten precious days, and with the British troops using the polluted Modder River as water supply, there was a typhoid epidemic killing many troops. General Cronjé was forced to surrender at Surrender Hill with 4,000 men.

The Battle of Paardeberg or Perdeberg ("Horse Mountain") was a major battle during the Second Anglo-Boer War. It was fought near Paardeberg Drift on the banks of the Modder River in the Orange Free State near Kimberley. Lord Methuen advanced up the railway line in November 1899 with the objective of relieving the besieged city of Kimberley (and the town of Mafeking, also under siege). Battles were fought on this front at Graspan, Belmont, Modder River before the advance was halted for two months after the British defeat at the Battle of Magersfontein. In February 1900, Field Marshal Lord Roberts assumed personal command of a significantly reinforced British offensive.

On 26 February, after much deliberation, Buller used all his forces in one all-out attack for the first time and at last succeeded in forcing a crossing of the Tugela to defeat Botha's outnumbered forces north of Colenso.

After a siege lasting 118 days, the Relief of Ladysmith was effected, the day after Cronjé surrendered, but at a total cost of 7,000 British casualties. Buller's troops marched into Ladysmith on 28 February.

In the third and final phase, beginning in March 1900 and lasting a further two years, the Boers conducted a hard-fought guerrilla war, attacking British troop columns, telegraph sites, railways, and storage depots. To deny supplies to the Boer guerrillas, the British, now under the leadership of Lord Kitchener, adopted a scorched earth policy. They cleared whole areas, destroying Boer farms and moving the civilians into concentration camps.

Battle of Poplar Grove. was an incident on 7 March 1900 during the Second Boer War in South Africa. It followed on from the Relief of Kimberley as the British Army moved to take the Boer capital of Bloemfontein. The Boers were demoralized following the surrender of Piet Cronjé at the Battle of Paardeberg.

After a succession of defeats, the Boers realized that against such overwhelming numbers of troops, they had little chance of defeating the British and so became demoralized. Roberts then advanced into the Orange Free State from the west, putting the Boers to flight at the Battle of Poplar Grove and capturing Bloemfontein, the capital, unopposed on 13 March with the Boer defenders escaping and scattering. Meanwhile, he detached a small force to relieve Baden-Powell.

On 15 March 1900, Lord Roberts proclaimed an amnesty for all burghers, except leaders, who took an oath of neutrality and returned quietly to their homes. It is estimated that between 12,000 and 14,000 burghers took this oath between March and June 1900.

British observers believed the war to be all but over after the capture of the two capital cities. However, the Boers had earlier met at the temporary new capital of the Orange Free State, Kroonstad, and planned a guerrilla campaign to hit the British supply and communication lines. The first engagement of this new form of warfare was at Sanna's Post on 31 March where 1,500 Boers under the command of Christiaan de Wet attacked Bloemfontein's waterworks about 37 kilometres (23 mi) east of the city, and ambushed a heavily escorted convoy, which caused 155 British casualties and the capture of seven guns, 117 wagons, and 428 British troops.

From late May 1900, the first successes of the Boer guerrilla strategy were at Lindley (where 500 Yeomanry surrendered), and at Heilbron (where a large convoy and its escort were captured) and other skirmishes resulting in 1,500 British casualties in less than ten days.

The Relief of Mafeking on 18 May 1900 provoked riotous celebrations in Britain, the origin of the Edwardian slang word "mafficking".

On 28 May, the Orange Free State was annexed and renamed the Orange River Colony.

Roberts was forced to halt again at Kroonstad for 10 days, due once again to the collapse of his medical and supply systems, but finally captured Johannesburg on 31 May and the capital of the Transvaal, Pretoria, on 5 June.

As Roberts's army occupied Pretoria, the Boer fighters in the Orange Free State retreated into the Brandwater Basin, a fertile area in the north-east of the Republic. This offered only temporary sanctuary, as the mountain passes leading to it could be occupied by the British, trapping the Boers. A force under General Archibald Hunter set out from Bloemfontein to achieve this in July 1900. The hardcore of the Free State Boers under De Wet, accompanied by President Steyn, left the basin early. Those remaining fell into confusion and most failed to break out before Hunter trapped them.

The set-piece period of the war now largely gave way to a mobile guerrilla war, but one final operation remained. President Kruger and what remained of the Transvaal government had retreated to eastern Transvaal. Roberts, joined by troops from Natal under Buller, advanced against them, and broke their last defensive position at Bergendal on 26 August.

By September 1900, the British were nominally in control of both Republics, with the exception of the northern part of Transvaal. However, they soon discovered that they only controlled the territory their columns physically occupied. Despite the loss of their two capital cities and half of their army, the Boer commanders adopted guerrilla warfare tactics, primarily conducting raids against railways, resource and supply targets, all aimed at disrupting the operational capacity of the British Army. They avoided pitched battles and casualties were light.

Roberts declared the war over on 3 September 1900; and the South African Republic was formally annexed.

After having conferred with the Transvaal leaders, Christiaan de Wet returned to the Orange Free State, where he inspired a series of successful attacks and raids from the hitherto quiet western part of the country, though he suffered a rare defeat at Bothaville in November 1900.

In December 1900, De la Rey and Christiaan Beyers attacked and mauled a British brigade at Nooitgedacht. As a result of these and other Boer successes, the British, led by Lord Kitchener, mounted three extensive searches for Christiaan de Wet, but without success.

In late January 1901, De Wet led a renewed invasion of Cape Colony. This was less successful, because there was no general uprising among the Cape Boers, and De Wet's men were hampered by bad weather and relentlessly pursued by British forces. They narrowly escaped across the Orange River.

On 25 February, Koos De La Rey attacked a British column under Lieutenant-Colonel S. B. von Donop at Ysterspruit near Wolmaransstad. De La Rey succeeded in capturing many men and a large amount of ammunition. The Boer attacks prompted General Methuen, the British second-in-command after Lord Kitchener, to move his column from Vryburg to Klerksdorp to deal with De La Rey.

The British offered terms of peace on various occasions, notably in March 1901, but were rejected by Botha and the "Bitter-enders" among the commandos. They pledged to fight until the bitter end and rejected the demand for compromise made by the "Hands-uppers." Their reasons included hatred of the British, loyalty to their dead comrades, solidarity with fellow commandos, an intense desire for independence, religious arguments, and fear of captivity or punishment. On the other hand, their women and children were dying every day and independence seemed impossible.

Paul Kruger's wife, however, was too ill to travel and remained in South Africa where she died on 20 July 1901 without seeing her husband again.

The Boer commandos in the Western Transvaal were very active after September 1901.

Several battles of importance were fought here between September 1901 and March 1902. At Moedwil on 30 September 1901.

Several battles of importance were fought here between September 1901 and March 1902. at Driefontein on 24 October

In January 1902, Boer leader Manie Maritz was implicated in the Leliefontein massacre in the far Northern Cape.

The Boer victories in the west led to stronger action by the British. In the second half of March 1902, large British reinforcements were sent to the Western Transvaal under the direction of Ian Hamilton.

On the morning of 7 March 1902, the Boers attacked the rear guard of Methuen's moving column at Tweebosch. Confusion reigned in British ranks and Methuen was wounded and captured by the Boers.

The opportunity the British were waiting for arose on 11 April 1902 at Rooiwal, where a commando led by General Jan Kemp and Commandant Potgieter attacked a superior force under Kekewich. The British soldiers were well positioned on the hillside and inflicted severe casualties on the Boers charging on horseback over a large distance, beating them back. This was the end of the war in the Western Transvaal and also the last major battle of the war.

Some burghers joined the British in their fight against the Boers. By the end of hostilities in May 1902, there were no fewer than 5,464 burghers working for the British.

On 6 May 1902 at Holkrantz in the southeastern Transvaal, a Zulu faction had their cattle stolen and their people mistreated by the Boers as a punishment for helping the British. The local Boer officer then sent an insulting message to the tribe, challenging them to take back their cattle. The Zulus attacked at night, and in a mutual bloodbath, the Boers lost 56 killed and 3 wounded, while the Africans suffered 52 killed and 48 wounded.

The last of the Boers surrendered in May 1902 and the war ended with the Treaty of Vereeniging signed on 31 May 1902.

31 May 1902, with 54 of the 60 delegates from the Transvaal and Orange Free State voting to accept the terms of the peace treaty.

President Kruger first went to Marseille and then on to the Netherlands, where he stayed for a while before moving finally to Clarens, Switzerland, where he died in exile on 14 July 1904.