South Africa has avoided falling into recession after second-quarter GDP figures showed the economy grew by 0.6% during the April-to-June period.
The economy had contracted by 0.6% in the first quarter. A platinum strike in the country was blamed for the poor performance in the first three months.
South Africa was last in recession in 2008 amid the global financial crisis.
By 2011 it had made a substantial recovery, but there have been worries recently that it would slip back.
Africa's most advanced economy, and the continent's second largest, grew by 1% compared with the same period a year earlier, against annual growth of 1.6% in the previous quarter.
South Africa's agriculture sector grew by 4.9% in the second quarter, while its financial sector expanded by 1.5%.
Meanwhile, the under-pressure mining sector contracted by 9.4% from the previous quarter while the manufacturing sector shrank by 2.1%.
Analysis: Lerato Mbele, BBC Africa business correspondent, Johannesburg
South Africa has narrowly avoided a recession. The focus should now be on growth.
The country has a high unemployment rate and more than eight million people out of work. To create jobs for a tenth of these citizens, South Africa would need to grow by at least 6% each year, experts say.
But even in the good years, before the 2008 global credit crisis, South Africa struggled to reach these numbers. Leaders, trade unions, researchers and voters have wondered how the most advanced and industrialised economy in Africa could fall so far back.
The answer lies somewhere in the archaic structure of the economy.
Mining is often referred to as the backbone of the economy, yet the sector makes up less than 10% of total economic activity. However, the mines earn more than 50% of the country's foreign exchange from their mineral exports.
Another major area of concern is manufacturing. South Africa's factories are not producing as much as before, mainly because of competition from Asia, and production costs are rising.
Fuel and electricity prices are higher, and the weaker South African currency has not helped the situation.
As a whole, the latest GDP figures prove that South Africa is not in recession, but clearly the fragile economy is not out of the woods.
Economists said the effect of the five-month strike on South Africa's platinum mines had spilled over into other sectors, and the hope of a quick improvement in the country's economic fortunes was distant.
Shilan Shah of Capital Economics said: "Looking ahead, there is little reason to expect a sharp turnaround in performance over the coming quarters."
Many analysts say that South Africa is also becoming the victim of a growing credit bubble.
Earlier this month, African Bank was bailed out by the country's central bank and South Africa's four largest banks were downgraded by ratings agency Moody's.
There is evidence that many South Africans use 70% of their income to service their debts.
Dr Cas Coovadia, the chief executive of the Banking Association of South Africa, said: "People are borrowing to get into a life style that, quite honestly, they cannot afford."
South Africa has high unemployment - around 25% of the workforce, or 8.3 million people.
"For an economy that's just not growing, ultimately it's not going to create the jobs," said the South African economist Mike Schussler.
"Whether it's a recession or not is a technical term - we are not growing," he added.