After 29 years in exile, Nujoma returned to Namibia in September 1989 to lead SWAPO to victory in the UN-supervised elections that paved the way for independence. Nujoma returned a day before the UN deadline for the Namibia people to register to vote for an election that would draft a constitution when it received its Independence from South Africa. The Constituent Assembly, elected in November 1989, chose him as Namibia's first president. Nujoma was sworn in on 21 March 1990, in the presence of Javier Perez de Cuellar, Secretary General of the UN, Frederik de Klerk, president of South Africa, and Nelson Mandela, just released from prison.