President Jacob Zuma has apologised to South Africans in an effort to end a long-running scandal over improper state spending at his private home.
“The matter has caused a lot of frustration and confusion, for which I apologise,” he said in a TV address.
He said he would abide by a court ruling that he must repay government money spent on upgrading his rural home with a swimming pool and amphitheatre.
The case was brought by the opposition, which urged him to stand down.
The public protector, an anti-corruption body, ruled in 2014 that $23m (£15m) of public money had been improperly spent on Mr Zuma’s rural home in Nkandla in KwaZulu-Natal province, and ordered him to reimburse part of the expense.
In Thursday’s unanimous judgement, the Constitutional Court of South Africa ruled that Mr Zuma’s failure to repay the money violated the constitution.
In his live address on Friday, Mr Zuma said: “I respect the judgement and will abide by it.”
The president added that he had acted “in good faith” and “never knowingly and deliberately set out to violate the constitution”.
“Any action that has been found not to be in keeping with the constitution happened because of a different approach and different legal advice,” he said, before issuing an apology for the “frustration” caused.
Mr Zuma has been in office since 2009, and his government has been widely accused of corruption and cronyism.
The case had been brought by two opposition parties, the Economic Freedom Fighters (EFF) and the Democratic Alliance (DA).
The EFF urged Mr Zuma to step down and the DA called for his impeachment.
Following the president’s address, Gwede Mantashe, secretary-general of Mr Zuma’s ANC party, described the calls as an “overreaction” by the opposition.