The esteem in which his shrewdness in both farming and legal affairs was held led to his election to the Volksraad as member for Wakkerstroom early in the sixties, Marthinus Pretorius being then in his second term of office as president. In 1870 Joubert was again elected, and the use to which he put his slender stock of legal knowledge secured him the appointment of attorney-general of the republic, while in 1875 he acted as president during the absence of T. F. Burgers in Europe.
During the first British annexation of the Transvaal, Joubert earned for himself the reputation of a consistent irreconcilable by refusing to hold office under the government, as Paul Kruger and other prominent Boers were doing. Instead of accepting the lucrative post offered him, he took a leading part in creating and directing the agitation which led to the First Boer War, eventually becoming, as commandant-general of the Boer forces, a member of the triumvirate that administered the provisional Boer government set up in December 1880 at Heidelberg. He was in command of the Boer forces at Laings Nek, Ingogo, and Majuba Hill, subsequently conducting the earlier peace negotiations that led to the conclusion of the Pretoria Convention.
Later political career
In 1883 he was a candidate in the Transvaal presidential election, but received only 1,171 votes as against 3,431 cast for Kruger. After losing to Kruger again in the 1888 elections, he ran against Kruger for a third time in the 1893 elections, standing as the representative of the comparatively progressive section of the Boers, who wished in some measure to redress the grievances of the Uitlander population which had grown up on the Rand. The poll was declared to have resulted in 7911 votes being cast for Kruger and 7246 for Joubert. After a protest Joubert acquiesced to Kruger's continued presidency. He stood again in 1898, but the Jameson raid had occurred meantime and the voting was 12,858 for Kruger and 2,001 for Joubert. Joubert's position had then become much weakened by accusations of treachery and of sympathy with the Uitlander agitation. He was a South African Freemason. He was appointed twice as the Vice President on Kruger, first time from May 1883 until the elections of 1888, and second time after the death of Nicolaas Smit from May 1896 until his death 28 March 1900.
Second Boer War
He took little part in the negotiations that culminated in the ultimatum sent to Great Britain by Kruger in 1899, and though he immediately assumed nominal command of the operations on the outbreak of hostilities, he gave up to others the chief share in the direction of the war, through his inability or neglect to impose upon them his own will. His cautious nature, which had in early life gained him the sobriquet of Slim Piet, joined to a lack of determination and assertiveness that characterized his whole career, led him to act mainly on the defensive; and the strategically offensive movements of the Boer forces, such as Elandslaagte and Willow Grange, appear to have been neither planned nor executed by him.
Death
On 28 November 1899, during a raid south of the Tugela river in Natal, Joubert was thrown from his horse and suffered internal injuries. As the war went on, physical weakness led to Joubert's virtual retirement, and, though two days earlier he was still reported as being in supreme command, he died at Pretoria from peritonitis on 28 March 1900. Sir George White, the defender of Ladysmith, summed up Jouberts character when he called him "a soldier and a gentleman, and a brave and honourable opponent".
Honours
The town of Pietersburg in the northern region of the then Transvaal Republic was named after Piet Joubert. Rudyard Kipling wrote a poem upon his death, Piet Joubert, wherein he absolved him from complicity in instigating the war, and held his colleagues to account :
With those that bred, with those that loosed the strife, He had no part whose hands were clear of gain; But subtle, strong, and stubborn, gave his life To a lost cause, and knew the gift was vain.