Roelof Frederik “Pik” Botha, who has died aged 86, became the world’s longest-serving foreign minister while acting as principal mouthpiece for the South African regime abroad – a daunting task which he carried out with remarkable aplomb and not without enjoyment.

Like other Afrikaner politicians, he could come across as slow when speaking English, as it was not his mother tongue, and so Botha was frequently underestimated. His stocky build, deep gravelly voice, military moustache and heavy features belied diplomatic skill and unexpected charm, gifts he deployed with panache. With his uncalvinistic joie de vivre, he could look flamboyant alongside such dour Afrikaner National party (NP) leaders as John Vorster, who promoted him, and his brutal namesake, PW Botha, who kept him on, as did FW de Klerk, the last head of the apartheid state.

His nickname, Pik, an abbreviation of pikkewyn, Afrikaans for penguin, derived from his juvenile pride in his first dark suit and reflected his lifelong fondness for donning a dinner jacket and going to a party. There was nothing he liked better than repartee over drinks at a braai (barbecue), where he was quite likely to do the cooking with all the application of a devoted bon vivant.

He was also a devoted party man in the political sense, a devotion which was not reciprocated by the NP machine. Yet the party, its leaders and the savage apartheid regime they ran for nearly half a century had no more valuable servant, all the more effective for his ingrained pragmatism. He shocked and antagonised NP colleagues in 1986 by predicting the advent of a black president and stating his readiness to serve under one – which he did.

Born at Rustenberg in the Afrikaner heartland of the old Transvaal, son of a teacher, the young Botha nearly died from meningitis at the age of four but fought off the ensuing muscular weakness. His education at an Afrikaans-medium school in Potchefstroom was followed by a law degree from Pretoria University. He showed promise in amateur dramatics and wrote prose and poetry in Afrikaans (a talent which enabled him to double his modest salary as a junior diplomat).

Botha shakes hands with Desmond Tutu at the Truth and Reconciliation Commission Hearings in Johannesburg in 1997. Photograph: Odd Andersen/AFP/Getty Images

He joined the Department of Foreign Affairs in 1953, the same year that he married Helena Bosman, with whom he was to have two sons and two daughters.

Junior posts in Sweden and West Germany were followed by secondment to the legal team fighting to retain Pretoria’s mandate in South West Africa (now Namibia, which was seized from the Germans in the first world war) at the international court of justice in The Hague. A rare Afrikaner in a ministry dominated by anglophones, he made progress on merit and remarkably swiftly.

He returned home to serve as legal adviser in 1966 and in 1968 became head of the ministry’s South West Africa and United Nations section, having joined the South African delegation to the UN general assembly in 1967 (he led it from 1974 to 1977, when he was also ambassador to the US).

From 1970 he managed to combine his heavy diplomatic workload with a parliamentary seat in the all-white House of Assembly at Cape Town, where he represented the Wonderboom constituency until 1974 when he was appointed permanent UN representative.

By the prevailing NP standard he was a liberal, and was suspected by hardliners of being a Soviet spy. To them, anyone who had worked “overseas” was tainted. Botha’s typically frank response was that, at diplomatic cocktail parties abroad, “nobody would talk to us and nobody would talk to the Russians, so we ended up always having to talk to each other”.

Exposure to the real world led Botha to argue in his maiden speech to the UN for South Africa to sign the UN Declaration of Human Rights, considered a communist sentiment in mainstream NP opinion. But party leaders by now regarded his diplomatic skills as indispensable and he was protected. They were much needed in 1975, when PW Botha, then the defence minister, invaded Angola from Namibia, apparently without warning Vorster, the prime minister. The Americans went along with it at first, but reversed course in 1976, forcing a humiliating South African withdrawal. Pik Botha, having warned Vorster of Washington’s U-turn, was unsullied. Vorster made him foreign minister in 1977.

This reward resembled promotion to first officer on the Titanic. The Portuguese had just abandoned their empire in Angola and Mozambique while Rhodesia’s UDI after 10 years was only an increasing economic and military liability for South Africa, now the last redoubt of white minority rule on the continent. Its preservation entailed more and more desperate measures, including a joint atomic bomb development programme with Israel, military missions in neighbouring countries, dirty tricks by security agencies and corrupt coups by the South African Department of Information in more distant places.

The military theorist Carl von Clausewitz would have described this as the continuation of foreign policy by other means, although the other means took precedence over the relatively presentable foreign policy fronted by Botha. So when Vorster in 1978 subsided into the sink of iniquity which the Information Department had become and PW Botha became premier, Pik Botha’s hands once again showed clean and he stayed on as foreign minister.

Botha with Margaret Thatcher, then the UK prime minister, after talks in 1979. Photograph: Walter Dhladhla/AFP/Getty Images

He even simultaneously took on the information portfolio until his namesake changed the constitution and made himself all-powerful state president in 1984. Polls showed that the white person in the street would have preferred Pik to lead the NP, as they did again when PW fell and de Klerk succeeded him in 1989; but Pik as ever lacked the necessary support within the embattled NP.

Having supported de Klerk against PW, Pik remained foreign minister until 1994, when the former handed over the presidency to Nelson Mandela – who kept Pik Botha in his cabinet as minister for energy until he retired from the NP and politics in 1996. The following year he appeared before the Truth and Reconciliation Commission, chaired by Archbishop Desmond Tutu, to seek forgiveness for his not negligible role in the promotion and preservation of apartheid.

He had, after all, been one of the longest-serving members, albeit often absent abroad, of a cabinet responsible for a catalogue of crimes against humanity whose full extent will probably never be known. Rambling through his apologia, Botha seemed more convincing in the role of penitent than most of his accomplices in oppression.

He caused one more political sensation by announcing in 2000 that he was seeking to join the African National Congress led by Thabo Mbeki, Mandela’s successor as president. Although Botha did come out in public support for Mbeki as president, he denied in an interview in 2013 that he had ever applied for membership of the ANC.

His wife died in 1996. Two years later he married Ina Joubert, who survives him, along with his four children.

• Pik Botha (Roelof Frederik Botha), politician, born 27 April 1932; died 12 October 2018