South African government bonds and the rand currency ended firmer on Wednesday, boosted after a minister said the government would keep a lid on spending and tracking gains elsewhere as global risk appetite picked up.

Deputy Finance Minister Nhlanhla Nene said Pretoria would let public debt rise to 40 percent of gross domestic product provided the spending was on investment, but would tighten the purse strings once debt reached those levels.

Analysts said Nene's comments helped reassure the market after data the previous day pointed to a larger-than expected budget deficit in the current year, raising the prospect of increased debt issuance which would be negative for bonds.

The yield on four-year paper fell 13 basis points to a three-week low of 6.83 percent and that for the 2026 bond dropped 10 basis points to 8.53 percent.

The rally today was predominantly driven by the risk appetite recovery globally as we saw rates also doing well in Hungary and Poland, similar high beta names, said Di Luo, EMEA fixed income strategist at HSBC in London.

Foreigners have sold local debt heavily along other emerging market assets in recent weeks, with bonds reversing strong gains that had pushed yields to historical lows in early September as the market priced in the chance of domestic rate cuts to boost stuttering economic growth.

I think there's more room for the South African Reserve Bank to deliver further monetary stimulus. Besides, the curve remains too steep -- too much risk premium is priced in, Luo said.

The rand was at 8.0520 to the dollar by 1644 GMT, up 0.59 percent from Tuesday's close, after earlier attempting to breach 8.0 but losing the momentum at 8.0090.

Overall, emerging markets have performed well today. If we can break 8.00 overnight then we probably can go to 7.85. Risk appetite seems to be improving a bit, a rand trader in Johannesburg who declined to be named said.