* Foreigners buy back into local bonds after record selloff
* Carry trade softens blow of fading "Ramaphoria effect"
* Emerging Market real yields graphic reut.rs/2K6SQVG
By Mfuneko Toyana
JOHANNESBURG, July 30 (Reuters) - Bouncing back from a record selloff, South African bonds last week recorded their best weekly inflows since February, as foreign investors ignored a grim economic outlook in favour of yields better than those in most emerging markets.
The rand also launched a surprise rally, trending closer to the crucial sub-13 level against the dollar, with investors cutting bearish bets and pushing the premium on insurance against sharp currency moves near its lowest since June.
Johannesburg Stock Exchange data showed foreigners had bought a net 5.6 billion rand ($425 million) in South African bonds last week, a fifth straight week of inflows and a turnaround from the more than 30 billion rand they offloaded last month .
"It's either you've got a high growth rate or a high yield differential. South Africa has the latter," said Wayne McCurrie of FNB Wealth and Investments, adding that lukewarm data from the United States had also cooled the rush into U.S. treasuries.
The continent's most industrialised economy is set to only narrowly avoid a recession after gross domestic product contracted by its most nearly a decade in the first quarter, the central bank said last week.
But investors are not perturbed, choosing to pick up the high return on offer by local bonds due to low inflation and relatively high interest rates.
Announcements by China last week that it would invest $14.7 billion in the economy also soothed sentiment.
Amongst emerging markets, South Africa has the second-best real return rate - the difference between the 10-year government bond and inflation - after Russia.
[Link to graphic: reut.rs/2K6SQVG]
"It is all about the carry-trade and the U.S. Dollar," said analyst at Nedbank Mehul Daya. "I also believe China reflating, both monetary and fiscal, is spurring investor optimism and as a result foreign flows have picked up."
JP Morgan said it was overweight South African bonds, with a bias to the short end of the curve.
"The repricing in local market bonds means higher yielding markets are more attractive on a real yield basis versus DM (developed markets) bonds, while low yielders are not," a JP Morgan analyst said.
South African assets have had rocky first half of the year.
Local assets rallied as Cyril Ramaphosa was elected head of the ruling African National Congress last November and state President in February, on a promise to reform the economy.
But a massive emerging market selloff in March triggered by rising lending rates in the U.S. and worries about the impact of the tit-for-tat trade tariff war between Washington and Beijing took the sheen off the economic euphoria termed "Ramaphoria".
"Ramaphoria is not dead, it's possibly delayed. What you have now is a bit of Ramapausia," McCurrie of FNB said. ($1 = 13.1663 rand)
Additional reporting by Karin Strohecker in London Editing by James Macharia, editing by Larry King