Rather than a rigid racial ideology, it is argued that South African apartheid was a pragmatic response of a white oligarchy to changing economic and political constraints. Consequently, the degree to which apartheid principles were applied and enforced by the South African state varied over time. A public choice model is developed to explain apartheid as endogenous policy, the parameters of which are determined by political support-maximizing politicians. The model suggests that the enforcement of apartheid was responsive to changes in such exogenous variables as defence costs, the gold price and the reservation wage of black unskilled labour. Predictions of the model hold implications for the causes of the democratic transition of the 1990s, including the role played by international sanctions.