Apartheid was a system of racial segregation in South Africa that allowed for differential treatment of people based on their race. During apartheid, South Africa's population was disproportionately white, with 19 million black South Africans and only 4.5 million white South Africans. The apartheid system imposed harsh discriminatory policies on black South Africans, requiring they carry pass books and restricting them to designated homelands. Nelson Mandela led opposition to apartheid and was imprisoned for 27 years before being released in 1990. He went on to help dismantle apartheid, establishing a multi-racial democracy in South Africa by 1996 when he became the country's first black president.