A South African court has ruled that the country's former President Jacob Zuma should be returned to prison, saying his medical parole was "unlawful".
The time he has spent out of prison should not be counted in his 15-month sentence, the Pretoria court ruled.
Zuma was released on 5 September for an undisclosed medical condition.
He had been jailed for failing to attend an inquiry into corruption during his presidency.
The 79-year-old handed himself in to police in July after a public stand-off, but his jailing, unprecedented for an ex-president, sparked violent protests and looting.
More than 300 people, mostly in Zuma's stronghold of KwaZulu-Natal province, died in the protests.
The former leader had testified only once at the inquiry into what has become known as "state capture" – the allegation that government decisions were being taken on behalf of business interests through a corrupt relationship.
Zuma is also facing a separate corruption and fraud trial related to an arms deal in the late 1990s.
Zuma has repeatedly said he is the victim of a political conspiracy.
Prison authorities say his release on parole was compelled by a medical report, but his ailment has never been disclosed.
He did, however, undergo surgery after he was imprisoned.
The former president's spokesman said at the time that imprisonment had had "an exponential impact in terms of deteriorating his condition". His lawyers also argued that their client's illness had rendered him incapacitated.
South Africa's main opposition party, the Democratic Alliance, which was part of the legal challenge against the decision to release Zuma from prison, welcomed Wednesday's ruling.
"This is a big victory for the rule of the law and the principle of equality before the law," its leader John Steenhuisen said.
The High Court in Pretoria ruled that the decision by the head of the correctional service Arthur Fraser, a known ally of Zuma, to release the former leader on medical parole was "reviewed, declared unlawful, and set aside".
Lawyers representing Zuma have appealed against the court order, so there is no immediate prospect of him returning to prison.
Find out more about Jacob Zuma:
- Jacob Zuma – the survivor whose nine lives ran out
- The trials of Jacob Zuma
- Zuma, the Guptas, and the sale of South Africa
Authorities preparing for possible protests
By Nomsa Maseko, BBC News, Johannesburg
The decision to revoke Zuma's parole has sent shockwaves across the country, with some of his supporters threatening mass protests reminiscent of the violence in July that left hundreds dead and led to costly destruction of businesses.
But other citizens have welcomed the ruling, saying it sends a strong message that all are equal before the law.
Many expect the former president to mount another vigorous legal fight against the ruling, he once said that serving a prison sentence – at his age and amid a global pandemic – was akin to a death sentence.
Rhetoric aside, the authorities here are not taking any chances and the BBC understands that law enforcement agencies, who were caught off-guard by the last unrest, are preparing to counter possible violent protests and looting if Zuma is jailed again.
Zuma's legal woes:
- 2005: Charged with raping family friend – acquitted in 2006
- 2005: Charged with corruption over multi-billion dollar 1999 arms deal – charges dropped shortly before he becomes president in 2009
- 2016: Court orders he should be charged with 18 counts of corruption over the deal – he appeals, but in 2017 loses a bid to overturn them
- 2016: Court rules he breached his oath of office by using government money to upgrade private home in Nkandla – he repays the money
- 2017: Public protector says he should appoint judge-led inquiry into allegations he profiteered from relationship with wealthy Gupta family – he denies allegations, as do the Guptas
- 2018: Zuma approves inquiry into claims of state looting
- 2018: The National Prosecuting Authority confirms Zuma will face prosecution for 12 charges of fraud, one of racketeering, two of corruption and one of money laundering, relating to the arms deal, which he denies
- 2021: Begins a 15-month jail sentence after the Constitutional Court orders his arrest for refusing to testify at the commission into state looting but later released on medical parole