Swellendam Commando can trace its origins back to around 1795 with the Republic of Swellendam and the unsafe situation for farmers on its eastern border with Xhosa tribes. An independent republic had been declared from the Dutch East India Company, declared with a National Assembly and Hermanus Steyn as president. It was a momentous event, but at the same time the British occupied the Cape and the new republic was called on to assist in battle. The republicans refused initially, but a commando of 70 soon left for the Cape. By 1806 with the Second British Occupation, at the Battle of Blaauwberg (6 January 1806), the Swellendam Commando again held the British off long enough for the rest of the Batavian army to retreat to safety.
The Government dreading a Khoi rising, made peace with the Xhosas. In 1801, another rebellion began where farms were abandoned en masse, and Khoi bands under Klaas Stuurman, Hans Trompetter and Boesak carried out widespread raids. The Swellendam commando under Comdt Tjaart van der Walt, who was killed in action in June 1802, achieved no permanent result.