South Africa is the continent's most industrialised economy and among its most developed, but marked by gaping inequalities rooted in years of racist white-minority rule that ended in 1994.
- Apartheid -
Black South Africans, around 80 percent of the population, voted for the first time only in 1994.
It was a moment of jubilation after a bitter decades-long struggle against white-minority rule.
British and Dutch settlers arrived at Africa's southern tip from the 17th century, first using it as a stopover on the shipping route to Asia and later claiming colonies.
They imposed discriminatory laws early on, restricting non-whites to unskilled jobs and limiting land ownership and free movement.
This developed into the radical system of apartheid, institutionalised in 1948, which kept the races apart with a host of discriminatory laws that disadvantaged black people in particular.
- Mandela -
Anti-apartheid hero Nelson Mandela became South Africa's first black president in 1994 after spending 27 years in jail when even his image was banned.
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's death in December 2013 unleashed a wave of public emotion around the world.
- 'Rainbow Nation' -
Post-apartheid South Africa painted itself as an example of democracy and tolerance, adopting 11 official languages, pledging free homes and education, and establishing a Truth and Reconciliation Commission.
But nearly 25 years on, much of the goodwill has been lost in corruption scandals and weak governance.
With a population of 55.7 million (2016), the country still has a "dual economy with one of the highest inequality rates in the world", the World Bank says.
Despite the emergence of a black middle-class, 47 percent of blacks lived in poverty in 2015 compared to 0.4 percent of whites, Statistics South Africa says.
Most of the country's arable land remains in the hands of white farmers.
- Economic woes -
South Africa accounts for 70 percent of the world production of platinum and is among the leading suppliers of gold, diamonds and coal. Manufacturing and agriculture are also key sectors.
Growth resumed in April 2017 after six months of recession but is estimated at only 0.7 percent in 2017.
Unemployment is at a record level of 27.7 percent, rising to 50 percent among youths, and business confidence is at its lowest level since the end of apartheid.
- Sunny SA -
With unspoiled beaches, winelands and animal reserves, the country was the continent's leading tourist destination behind Morocco in 2016.
There were more than 10 million visitors in 2016, a near 13 percent rise from the previous year, and the sector employs one in 22 people with jobs.
- Crime, HIV -
South Africa suffers high levels of crime, including 34 homicides per 100,000 inhabitants in 2015/16, according to police, higher than other countries considered dangerous such as Colombia and Brazil.
It also has the largest HIV epidemic in the world, with 19 percent of the global number of people living with HIV, 15 percent of new infections and 11 percent of AIDS-related deaths.
Sources: Statistics South Africa, UNAIDS, UNESCO, World Bank, World Tourism Authority.