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