Broadly speaking, apartheid was delineated into petty apartheid, which entailed the segregation of public facilities and social events, and grand apartheid, which dictated housing and employment opportunities by race. Prior to the 1940s, some aspects of apartheid had already emerged in the form of minority rule by White South Africans and the socially enforced separation of Black South Africans from other races, which later extended to pass laws and land apportionment. Apartheid was adopted as a formal policy by the South African government after the election of the National Party (NP) at the 1948 general election.
A codified system of racial stratification began to take form in South Africa under the Dutch Empire in the late-eighteenth century, although informal segregation was present much earlier due to social cleavages between Dutch colonists and a creolised, ethnically diverse slave population. With the rapid growth and industrialisation of the British Cape Colony in the nineteenth century, racial policies and laws became increasingly rigid. Cape legislation that discriminated specifically against Black South Africans began appearing shortly before 1900. The policies of the Boer republics were also racially exclusive; for instance, the Transvaal's constitution barred Black and Coloured participation in church and state.
The first apartheid law was the Prohibition of Mixed Marriages Act, 1949, followed closely by the Immorality Amendment Act of 1950, which made it illegal for most South African citizens to marry or pursue sexual relationships across racial lines. The Population Registration Act, 1950 classified all South Africans into one of four racial groups based on appearance, known ancestry, socioeconomic status, and cultural lifestyle: "Black", "White", "Coloured", and "Indian", the last two of which included several sub-classifications. Places of residence were determined by racial classification. From 1960–1983, 3.5 million Non-White South Africans were removed from their homes and forced into segregated neighbourhoods, in one of the largest mass evictions in modern history. Most of these targeted removals were intended to restrict the Black population to ten designated "tribal homelands", also known as bantustans, four of which became nominally independent states. The government announced that relocated persons would lose their South African citizenship as they were absorbed into the bantustans.
Between 1987 and 1993, the National Party entered into bilateral negotiations with the African National Congress, the leading anti-apartheid political movement, for ending segregation and introducing majority rule. In 1990, prominent ANC figures such as Nelson Mandela were released from prison. Apartheid legislation was repealed on 17 June 1991, pending fully democratic, multiracial elections set for April 1994.