On 16 May 1876, President Thomas François Burgers of the South African Republic (Transvaal) declared war against Sekhukhune and the Pedi. Sekhukhune managed to defeat the Transvaal army on 1 August 1876. Another attack by the ''Lydenburg Volunteer Corps'' was also repulsed. On 16 February 1877, the two parties signed a peace treaty at Botshabelo. The Boers' inability to subdue Sekhukhune and the Pedi led to the departure of Burgers in favour of Paul Kruger and the British annexation of the South African Republic (Transvaal) on 12 April 1877 by Theophilus Shepstone, secretary for native affairs of Natal. In 1878 and 1879 three British attacks were successfully repelled until Garnet Wolseley defeated Sekhukhune in November 1879 with an army of 2,000 British soldiers, Boers and 10,000 Swazis.