Apartheid was a system of legal racial segregation in South Africa between 1948 and 1994. It was enforced by the ruling National Party to maintain minority rule by the white population. Key events included the introduction of apartheid laws in 1948, classifying the population by race in 1950, and restricting the rights of non-white South Africans over the following decades through laws restricting where they could live, work, and travel. Anti-apartheid activism grew both within and outside South Africa, leading to its end with South Africa's first democratic election in 1994 in which Nelson Mandela was elected president.