South Africa on Friday ducked a much-feared downgrade of its debt to "junk" status as the S&P Global-Ratings agency stood by its current ratings.
The agency warned, however, that the outlook for South Africa's rating remains negative because of weak growth and political tensions.
S&P currently rates South Africa's long-term debt at BBB-, just one notch above junk, a status that prevents many international investors from buying into sovereign bonds.
The government, facing unemployment at 26 percent and increasing social unrest in one of the world's most unequal societies, welcomed S&P's decision to put a long-expected downgrade on hold.
"The benefit of this decision is that South Africa is given more time to demonstrate further concrete implementation of reforms that are underway," the treasury said in a statement.
"The rating outcome demonstrates that South Africans can unite, especially during difficult times, to achieve a common mission."
The country has been plagued by political controversy and growth this year is expected to hit its lowest since the 2008 world economic crisis.
The International Monetary Fund (IMF) forecasts a meagre 0.6 percent growth, while one of the country's four leading banks, Nedbank, expects 2016 "to be a very weak year, with growth of only 0.2 percent".
Africa's most advanced economy, which expanded by an average 5.0 percent between 2004 and 2007, has also been hit by weak international commodity prices and the economic slowdown in China, plus the worst drought in 100.
But it is the political upheavals, particularly President Jacob Zuma's sudden sacking of finance minister Nhlanhla Nene in December, that have prompted the rand to slide sharply against the dollar, fuelling inflation.
Zuma's tense relations with current Finance Minister Pravin Gordhan, who is seen as trying to clean up corruption and wasteful expenditure in government, have also worried investors.
Gordhan's efforts have been credited by many analysts for giving South Africa the chance to avoid a downgrade, but local media insist that Zuma wants to get rid of him to ensure access to the treasury for himself and his cronies.
- 'Recipe for a downgrade' -
Analysts warn that while South Africa has survived a downgrade, it is not out of the woods, and relegation to sub-investment grade level remains on the cards by December.
"On the growth front the economy is not likely to improve significantly during the next six months and that will be a recipe for a downgrade," Nedbank economist Isaac Matshego told AFP.
However, averting a downgrade now was "an important confidence-booster, especially for increasingly controversial President Jacob Zuma," UK-based Manji Cheto of Teneo Intelligence said in a note.
Moody's rating agency last week maintained South Africa's status at two notches above junk, while Fitch is expected to release its review next week.
Zuma, who faces a prospect of prosecution for corruption charges dating back to before he took power, has endured a series of scandals in recent months.
He has retained the support of the ruling African National Congress (ANC) so far, but analysts say his position could be precarious if the party suffers major losses in local elections in August.
With poverty still widespread more than 20 years after the end of apartheid and unemployment at an official 26.7 percent, violent social protests are common around the country.
"South Africa’s economic and political climate has deteriorated significantly, unemployment has increased, interest rates have spiked, and business and consumer confidence is low," Novare's Francois Botha said after the S&P announcement.
"If we don’t find a catalyst for growth within the next few months then a downgrade would be inevitable," he said.