In the early 1980s, Louis Pienaar was assigned to Paris as South Africa's ambassador to France.
On 1 July 1985, Pienaar was appointed by the National Party government to be Administrator-General (AG) of South-West Africa, a territory that the United Nations Security Council called Namibia and which UNSC Resolution 435 of 1978 declared was being administered illegally by South Africa. Two years after AG Pienaar's appointment, when prospects for Namibian independence seemed to be improving, UN Commissioner for Namibia (UNCN) Bernt Carlsson, was appointed. Upon South Africa's relinquishing control of Namibia, Commissioner Carlsson's role would be to take over the administration of the country on behalf of the UN, formulate its framework constitution, and organise free and fair elections based upon a non-racial universal franchise.
In May 1988, a United States mediation team – headed by Chester A. Crocker, US Assistant Secretary of State for African Affairs – brought negotiators from Angola, Cuba, and South Africa, and observers from the Soviet Union together in London. Later in May, at the Reagan/Gorbachev summit in Moscow (29 May – 1 June 1988), it was decided that Cuban troops would be withdrawn from Angola, and Soviet military aid would cease, as soon as South Africa withdrew from Namibia. The New York Accords – agreements to give effect to these decisions – were drawn up for signature at UN headquarters in New York City in December 1988. Cuba, South Africa, and the People's Republic of Angola agreed to a total Cuban troop withdrawal from Angola. This agreement – known as the Brazzaville Protocol – established a Joint Monitoring Commission (JMC), with the US and the Soviet Union as observers, to oversee implementation of the accords. A bilateral agreement between Cuba and Angola was signed at UN headquarters on 22 December 1988. On the same day, a tripartite agreement between Angola, Cuba and South Africa was signed, whereby South Africa agreed to hand control of Namibia to the United Nations.
(Tragically, UNCN Bernt Carlsson was not present at the signing ceremony. He was killed on flight Pan Am 103 which exploded over Lockerbie, Scotland on 21 December 1988 en route from London to New York. South African foreign minister Pik Botha and an official delegation of 22 had a lucky escape. Their booking on Pan Am 103 was changed at the last minute, and Botha, together with a smaller delegation, caught the earlier Pan Am 101 flight to New York.)
UN Security Council adopted resolution 632 on 16 February 1989 requiring that implementation of UNSCR 435 should officially start on 1 April 1989. AG Pienaar, under the supervision of UN Special Representative Martti Ahtisaari who arrived in Windhoek in April 1989 to head the United Nations Transition Assistance Group, began Namibia's transition to independence. The transition got off to a shaky start because, contrary to SWAPO leader Sam Nujoma's written assurances to the UN Secretary-General to abide by an agreed cease-fire and repatriate from Angola only unarmed Namibians, the South Africans alleged that approximately 2,000 armed members of the People's Liberation Army of Namibia (PLAN), SWAPO's military wing, crossed the border from Angola in an apparent attempt to establish a military presence in northern Namibia. Under pressure from AG Pienaar and South Africa's foreign minister Pik Botha, UNTAG's Martti Ahtisaari took advice from British Prime Minister, Margaret Thatcher, who was visiting Southern Africa at the time, and authorised a limited contingent of South African troops to aid the South West African Police (SWAPOL) in restoring order. A period of intense fighting followed, during which 375 PLAN fighters were reported to have been killed.
On 7 April, AG Pienaar announced that he was unilaterally suspending the independence process, but his decision was quickly repudiated by Pik Botha.
On 11 April, He stated that, contrary to previous undertakings, UNTAG and the South African security forces had "agreed that PLAN soldiers would be interrogated in order to verify the suspected number of infiltrators". Botha overruled AG Pienaar's statement saying "there is no question of interrogation".
On 22 May, AG Pienaar proclaimed AG 11 of 1989: "Establishment and Powers of the Commission for the Prevention and Combatting of Intimidation and Electoral Malpractices". On 8 June, AG 14 of 1989 was proclaimed: "First Law amendment (Abolition of Discriminatory or Restrictive Laws for purposes of Free and Fair Elections)".
On 12 June, AG Pienaar declared a general amnesty against prosecution for all Namibians living abroad and repealed or amended 46 discriminatory laws. (He extended the amnesty eight months later to South African officials and security personnel including the South African Defence Force.)
Following complex negotiations with UNTAG concerning electoral voting procedures, AG Pienaar proclaimed AG 19 of 1989: "Registration of Voters (Constituency Assembly Proclamation)" on 30 June. Registration of voters began on 4 July, and AG Pienaar published a draft proclamation on the election process on 21 July. UNTAG was concerned by this draft, insisting that political party agents should be present at the polling stations and at the counting of the votes. In this way, the Namibian people could be reassured that the voting would be free and fair. The South African side opposed the idea, indicating their determination to dominate the constitution-making process and retain control for as long as possible.
On 13 October, AG Pienaar proclaimed AG 49 of 1989: "The Holding of an Election for a Constituent Assembly".
At the end of August, the UN Security Council called for the immediate demobilization of all paramilitary groups in Namibia (UNSCR 640 of 1989) and a week later AG Pienaar announced he was suspending the activities of the Koevoet paramilitary force. The Koevoet issue had been one of the most difficult UNTAG faced. This counter-insurgency unit was formed by South Africa after the adoption of UNSCR 435, and was not, therefore, mentioned in the settlement proposal or related documents. The UN regarded Koevoet as a paramilitary unit which ought to be disbanded but the unit continued to deploy in the north in armoured and heavily armed convoys. In June 1989, Martti Ahtisaari told AG Pienaar that this behaviour was totally inconsistent with the Settlement Proposal, which required the police to be lightly armed. Moreover, the vast majority of the Koevoet personnel were quite unsuited for continued employment in the South West African Police (SWAPOL). Pik Botha announced on 28 September 1989 that 1,200 ex-Koevoet members would be demobilized with effect from the following day. A further 400 such personnel were demobilized on 30 October. These demobilizations were supervised by UNTAG military monitors.
The 11-month transition period ended relatively smoothly. Political prisoners were granted amnesty, discriminatory legislation was repealed, South Africa withdrew all its forces from Namibia, and some 42,000 refugees returned safely and voluntarily under the auspices of the Office of the UN High Commissioner for Refugees (UNHCR). Almost 98% of registered voters turned out to elect members of the Constituent Assembly. The elections were held in November 1989 and were certified as free and fair by UN Special Representative Martti Ahtisaari, with SWAPO taking 57% of the vote, just short of the two-thirds necessary to have a free hand in revising the framework constitution that had been formulated not by UNCN Bernt Carlsson but with the help of AG Pienaar. The opposition Democratic Turnhalle Alliance received 29% of the vote. The Constituent Assembly held its first meeting on 21 November 1989 and resolved unanimously to use the 1982 Constitutional Principles in Namibia's new constitution.
(According to The Guardian of 26 July 1991, Pik Botha told a press conference that the South African government had paid more than £20 million to at least seven political parties in Namibia to oppose SWAPO in the run-up to the 1989 elections. He justified the expenditure on the grounds that South Africa was at war with SWAPO at the time.)
Namibia's Independence Day celebrations took place in the Windhoek Sports Stadium on 21 March 1990. Numerous international representatives attended, including 20 heads of state, and the arrival of Nelson Mandela, who had just been released from prison, caused excitement among the 30,000 spectators. United Nations Secretary-General, Javier Pérez de Cuéllar, and the President of South Africa, F W de Klerk, jointly conferred independence on Namibia. AG Pienaar formally handed over power to the president of SWAPO, Sam Nujoma, who was then sworn in as the first President of Namibia.
In 1990, on his return to South Africa, Louis Pienaar was nominated to be Minister of Education in President F W de Klerk's government where he was responsible for the dismantling of the structures of apartheid. From May 1992 until April 1993, Pienaar was Minister for Internal Affairs.
Pienaar died at his residence in Cape Town on 5 November 2012.