A resurgent currency and the return of foreign investment have helped South African bonds to the top of the emerging-market pile.

Rand-denominated government debt has returned 6.5% in dollar terms this month, the best performance out of 19 major emerging markets tracked by Bloomberg Barclays indexes. The average for developed-nation peers was less than 0.1%.

That’s quite a turnaround from the last quarter, when South Africa’s bonds bore the brunt of an emerging-market sell-off, losing 17%, with only Turkey and Argentina doing worse. Since then, global risk appetite has improved, while South Africa’s President Cyril Ramaphosa nailed down investment pledges totalling $35.5 billion as he campaigns to attract $100 billion to boost the flagging economy.

“Both the rand and South African government bonds have been rather resilient recently due to improved sentiment on news around investment undertakings by Saudi Arabia, China and the UAE.,” Zaakirah Ismail, a fixed-income specialist at Standard Bank, wrote in a client note on Monday. “The announcements have revived sentiment.”

That shows in foreign-investor demand for the country’s bonds. After a record sell-off spanning almost three months, non-residents have been net buyers for the past three weeks. Friday alone saw a net inflow of R2.4 billion, the most in a day since March 13.

South Africa needs portfolio flows to help plug a persistent current-account deficit and support the rand, which has gained 4.2% in July, further boosting returns on the country’s bonds for dollar investors.