South Africa's former president, Jacob Zuma, has been ordered to return to jail.
The Gauteng High Court in Pretoria ruled on Wednesday that a prior decision to release him on medical parole was "unlawful."
His legal team has filed a request to appeal Judge Elias Matojane's decision.
Zuma, who served two terms as president between 2009 and 2019, was granted medical parole in September just two months into a 15-month prison sentence for contempt of court.
The then National Commissioner of Correctional Services Arthur Fraser released Zuma despite the medical parole advisory board's recommendation against it.
The country's official opposition party, the Democratic Alliance (DA), asked the court to overrule Fraser's decision.
"This is a big victory for the rule of law," DA leader, John Steenhuisen, said on Twitter.
Zuma remains a controversial figure
Zuma was found guilty of contempt in June after refusing to obey a court order to appear before a commission probing corruption and fraud. The Zondo commission, named after the judge who heads it, is investigating "state capture" during Zuma's tenure.
His initial imprisonment sparked a series of violent protests in which more than 350 people died.
Despite being on parole on grounds of ill health Zuma launched a new book on Sunday, Jacob Zuma Speaks.
He said he hoped the book would help "to the set record straight".
Looking healthy in a video during the book launch Zuma said there had been a lot of "untruth about the work that we have done."
Zuma faces additional charges
Zuma is also facing 16 fraud, graft and racketeering charges related to a 1999 purchase of arms from five European firms.
He was the deputy president at the time and is accused of pocketing bribes from French defense giant Thales.
The legal process has been delayed several times as his lawyers argued he was too sick to attend court.
Zuma has repeatedly claimed the justice system was hounding him for political motives.