Twenty-five years after the end of white-minority rule, South Africa remains one of the most unequal countries in the world and is held back by corruption and crime.
Ahead of May 8 elections in which the African National Congress (ANC) is seeking to retain power, here is some background:
Decades of apartheid
The radical race-based system of apartheid that favoured the white minority over the black majority became official government policy in 1948.
It governed all aspects of life, restricting non-whites to unskilled jobs and inferior education, services and living conditions.
Whites controlled politics, the economy and the land.
The system was dismantled nearly five decades later, after a long and bitter struggle, its demise sealed by the April 1994 elections in which blacks were able to vote for the first time.
Then ANC leader Nelson Mandela, who was jailed for 27 years for his efforts to overthrow apartheid, became South Africa's first black president in 1994.
His release in 1990 heralded the transition to democracy for which he won the Nobel Peace Prize with the last white president, F.W. de Klerk.
Mandela committed to only one term, stepping down in 1999. Internationally respected as an icon of reconciliation, his death in 2013 was met with an outpouring of emotion worldwide.
Later, in-fighting and graft scandals within the ANC peaked in 2018 when Jacob Zuma was forced to step down as president.
'Rainbow Nation' tarnished
The optimism of the post-apartheid "Rainbow Nation" has waned amid widespread complaints of weak governance, poor delivery of public services, corruption and crime.
The number of regular houses, as opposed to makeshift shacks, increased by a quarter since 1996, as did access to electricity (61 percent), according to a Centre for Risk Analysis survey in 2019.
But some 20 percent of black households are classed as living in extreme poverty compared to 2.9 percent of white households, the Institute of Race Relations says.
With a population of 56.7 million (2017), the country still has "one of the highest inequality rates in the world," the World Bank says.
Most of South Africa's arable land, meanwhile, remains in the hands of white farmers.
The second-strongest economy in Africa behind Nigeria, South Africa is the world's top producer of platinum and a leading supplier of gold, diamonds and other minerals.
However, mining has shed about 300,000 jobs, now only making up about seven percent of gross domestic product from a peak of about 20 percent in the 1980s.
Having seen sharp gains from 1994 to 2006 with annual growth above five percent, the economy crashed in 2008 at the height of the global financial crisis.
Growth was just 0.8 percent in 2018 and is projected to be 1.3 percent for 2019, the World Bank says.
Official unemployment is at 27.1 percent, reaching 53 percent for people aged under 35 -- among the highest in the world.
With unspoiled beaches, vineyards and animal reserves, the country was the continent's leading tourist destination behind Morocco in 2017, according to the UN's tourism authority.
There were more than 10 million visitors in 2017, and the sector contributed 10 percent to the economy.
The country hosted Africa's first World Cup in 2006 and is also the sole nation on the continent to allow gay marriage.
But crime remains persistently high, the murder rate rising in 2017 to about 57 a day.
South Africa also has the biggest HIV/AIDS epidemic in the world, with 7.1 million people living with HIV, the UN says.