South African stocks inched to their highest close in seven sessions on Tuesday, rising 0.5 percent as banks and retailers rose on hopes a budget vote in Italy could help move the euro zone closer to resolution of its debt crisis.

Shares of exchange operator JSE Ltd fell after Africa's biggest bourse sacked its head of equities derivatives for irregular trading on his own account.

Investors were optimistic as Italy's budget vote hinted that Prime Mininster Silvio Berlusconi had lost his parliamentary majority, piling further pressure on him to resign.

There is a lot of optimism about the packages they want to put up in Europe and commodity prices are still staying strong and have a very good influence on our markets, said Rigardt Maartens, a portfolio manager at PSG Konsult.

I think we can see the market a bit stronger in the rest of the week as the market is on an upward momentum at this moment, though it could turn volatile.

Johannesburg's Top-40 index rose 0.5 percent to 29,320.72, its highest finish since late October.

The All-share index also gained 0.5 percent, to 32,670.42.

Banks were higher, with Investec rising 1.4 percent to 47.85.

Johannesburg-listed shares of luxury goods maker Richemont gained 2.5 percent to 43.87 rand, while clothing retailer Truworths gained 2.4 percent.

Shares of South African media and e-commerce firm Naspers slid 2.7 percent to 379.80, tracking a sharp decline in China's Tencent Holdings, of which Naspers owns more than 30 percent.

Shares of Tencent ended down 5.5 percent in Hong Kong trade, reflecting investor skittishness a day before China's largest Internet firm releases its third-quarter earnings.

Tencent has been a major growth driver for Naspers, and Tencent's share price often impacts that of Naspers.

Trade on the exchange was relatively active, according to preliminary data available at 1500 GMT, which showed 182.5 million shares changing hands.

Advancers outnumbered decliners, 167 to 96.