Nelson Mandela was released from a South African prison in 1990 after being detained for 27 years as a political prisoner. He was the first elected president of South Africa from 1994 to 1999.