Former South African president Jacob Zuma on Friday withdrew from testifying to an inquiry into corruption during his rule, complaining of bias, before later agreeing to return at a future date.
In the corruption scandal popularly referred to as "state capture", Zuma is alleged to have overseen mass looting of state assets during his nine-year tenure.
Zuma on Friday morning pulled out of the inquiry, with his legal team saying their client would no longer participate as he had been "treated as someone who was accused".
But after behind-the-scenes discussions, deputy chief justice Raymond Zondo, who is chairing the investigation, announced an agreement had been reached between parties.
"The former president will come back at another time that will be arranged," Zondo announced. "The discussions have resulted in an agreement."
Zuma said he was "happy" that a compromise had been reached.
"No one should have a wrong impression that the raising of the concerns was just done in order to disrupt the processes, these were genuine concerns," he added.
The ex-president was due to give the last of his evidence on Friday but had complained that earlier questioning was effectively a court cross-examination.
Zuma had dismissed all accusations made against him by previous witnesses to the inquiry.
He replied to many questions at the inquiry by saying he did not remember or was unaware of meetings and conversations that other witnesses had mentioned.
On Monday, the first day of his testimony, Zuma gave a rambling address saying he was the victim of conspiracies and years of "character assassination", and accusing foreign intelligence agencies and spies of working against him.
He also said he had received multiple death threats and attempts on his life.
Zuma, 77, was ousted by the ruling ANC party in 2018 and replaced by his deputy, Cyril Ramaphosa, who has vowed to clean up the government.
He was not legally summonsed to attend the inquiry, but was invited to reply after being implicated in graft by several previous witnesses.
The inquiry is investigating a web of deals involving government officials, the wealthy Gupta business family and state-owned companies.
The Indian-born Gupta brothers -- Ajay, Atul and Rajesh -- have left South Africa and are now based in Dubai.
One witness, former finance minister Nhlanhla Nene testified that Zuma pushed policies on nuclear power and aviation that were designed to benefit the Gupta family.
"Mr Zuma and his legal team are in effect asking to be excused from the application of the rules," the inquiry's lead lawyer Paul Pretorius said.
"If the questions are detailed and if the questions are difficult... so be it.
"We are not only entitled, but obliged to ask those questions."
Zuma was forced to set up the commission in January 2018, shortly before he left office, after failing in a legal battle to overturn the instructions of the country's ethics ombudsman.
It has been holding hearings since last year and is due to complete a report next year that may lead to criminal prosecutions.
Zuma has also been charged with 16 counts of graft linked to a 1990s arms deal made before he became president.