South Africa will find it harder to raise funds and service its foreign debt after a worsening of external financing conditions in recent months due to a fall in the rand and rising bond yields, Moody’s said on Tuesday.

Moody’s was the last of the top three major rating agencies to rate South Africa’s investment grade. In March it affirmed that rating and revised its outlook to stable from negative, citing an improving policy framework.

However, in a research note published on Tuesday it flagged potentially tougher times ahead: “Tightening external conditions can affect the overall cost of debt for the government, both through the availability and cost of external finance and if currency pressure leads the South African Reserve Bank to raise policy rates significantly.”

South Africa’s public debt has risen to more than 50 percent of gross domestic product over the past decade as fiscal and policy missteps under former president Jacob Zuma, including firing two respected finance ministers, which saw the country downgraded to junk by two of the top three rating firms.

While investor confidence was soothed by Cyril Ramaphosa’s election as president in February, enthusiasm has waned as growth numbers disappointed and uncertainty around new land and mining policies weighed.

In recent months, the rand and bonds suffered in a global emerging market rout triggered by rising lending rates in the United States and fears that a spat between the US and China could boil over into a full blown trade war.

Data last month showed foreign investors had sold more since the start of the year than during the 2008 global financial crisis and the dot-com crash between 2000 and 2001.

Moody’s also highlighted risks related to the rising share of non-resident holdings of government debt, and said that the sharp portfolio outflows were resulting in higher debt servicing costs which would hamper the country’s fiscal flexibility.