Apartheid ended in 1991. Mandela was elected the countrys first black president.