Apartheid in South Africa was caused by the National Party, an all-white government that enforced a strong policy of racial segregation through legislation. This legislation was known as apartheid, and had roots in the 1913 Land Act after South African independence.
Apartheid forced nonwhite South Africans, which was the majority of the population, to live in separate areas from the white people and to use separate public facilities. The two groups had limited contact with one another, and even though there was strong ongoing opposition from other countries, the apartheid held for nearly 50 years.
It was not until 1991 that the legislation began to be repealed. Nelson Mandela spent 27 years in prison, and when he was finally freed in 1990, he helped to end the apartheid in South Africa. South Africa was also forced by the international community to stop apartheid legislation. There were economic sanctions and mandatory embargo sanctions.
In 1994, it was the end of apartheid. An election that year led to a coalition government that had a nonwhite majority. This coincided with the creation of a new constitution that promoted all racial groups and repealed the Population Registration Act. Although the South Africans had a long way to go in uniting their country and erasing racial boundaries, they permanently got rid of apartheid.