South Africa country profile
South Africa has one of the continent's biggest and most developed economies.
Up until 1994 it was ruled by a white minority government, which enforced a separation of races with its policy called apartheid.
The apartheid government eventually negotiated itself out of power after decades of international isolation, armed opposition and mass protests.
The democratically-elected leadership encouraged reconciliation and set about redressing social imbalances, but the economy has struggled.
Republic of South Africa
Administrative capital: Pretoria
Population 50.7 million
Area 1.22 million sq km (470,693 sq miles)
Major languages 11 official languages including English, Afrikaans, Sesotho, Setswana, Xhosa and Zulu
Religions Christianity, Islam, indigenous beliefs
Life expectancy 53 years (men), 54 years (women)
President: Cyril Ramaphosa
Cyril Ramaphosa was elected president by parliament in February 2018 after his predecessor, Jacob Zuma, resigned.
A successful businessman, Mr Ramaphosa was picked as leader of the ruling African National Congress (ANC) a few months earlier.
He inherited a struggling economy, a divided party and the problem of entrenched corruption.
Unlike many senior party figures of his generation, Mr Ramaphosa was not driven into exile for opposing apartheid.
He fought the injustices of white minority rule from within South Africa, most prominently by defending the rights of black miners as leader of the National Union of Mineworkers (NUM).
He was heavily involved in talks ending apartheid and played an important role in the drafting of South Africa's post-apartheid constitution.
After missing out on becoming then President Nelson Mandela's deputy, Mr Ramaphosa withdrew from active political life, switching focus to business.
South Africa is the continent's major media player, and its broadcasters and press reflect the diversity of its people.
Established state-run and commercial TV broadcast nationally, and hundreds of thousands of viewers subscribe to satellite and cable. South Africa-based MultiChoice markets satellite pay-TV in dozens of African countries.
Some key events in South Africa's history:
1910 - Formation of Union of South Africa by former British colonies of the Cape and Natal, and the Boer republics of Transvaal, and Orange Free State.
1912 - Native National Congress founded, later renamed the African National Congress (ANC).
1948 - Policy of apartheid (separateness) is adopted when National Party (NP) takes power.
1960 - Seventy black demonstrators killed at Sharpeville. ANC banned.
1976 - More than 600 killed in clashes between black protesters and security forces during uprising which starts in Soweto. The challenge to white rule escalates over the years.
1991-1994 - Negotiated end to apartheid leads to first non-racial elections and formation of a Government of National Unity under Nelson Mandela.
2009 May - Parliament elects Jacob Zuma as president. He resigns in 2018 over corruption charges.