Johannesburg - Government said on Saturday a labour court had granted an injunction banning civil servants in essential services from taking part in strike by more than one million public sector workers.
The strike, which started on Wednesday, is the latest in a wave of labour protests to hit the country since May and has involved teachers, police, health workers, customs officials and office staff.
Government spokesperson Themba Maseko told Reuters that essential services include hospital and correctional facilities, and that the workers are expected to return to work immediately.
The Independent Labour Caucus (ILC), one of the unions involved in wage talks with government, said it agreed with the principle that there must be guidance in the provision of essential services.
"But in the absence of an agreement, (the injunction) can only be regarded as an interim measure. It is absolutely necessary that we reach an agreement as quickly as possible," said ILC spokesperson Chris Kloppers.
The injunction also stops the striking workers from intimidating those reporting to work as well as the public.
The strike turned violent on Thursday, with police firing rubber bullets to disperse protesters blocking roads and preventing patients from entering hospitals.
State workers' unions are demanding an 8.6% pay rise, more than double the inflation rate, and R1 000 a month for housing.
Last week the government raised the housing allowance to R700 from a previous offer of R630, but refused to increase its wage rise offer of 7%. Annual inflation now stands at 4.2%.
Any agreement will likely swell state spending by about 1% to 2%, forcing the government to find funds to pay for the deal as it tries to bring its deficit down from 6.7% of gross domestic product.
The government has repeatedly said it cannot afford the more than double inflation wage increase demand from public sector unions. The central bank has warned that a series of above-inflation increases so far could fan inflation.