South African president Jacob Zuma has denied acting dishonestly in a scandal over improper state spending at his private home, after a scathing court ruling prompted calls for him to resign.
The scandal is arguably the biggest yet to hit Zuma, who has fended off accusations of corruption, influence peddling and even rape since before he took office in 2009.
It comes ahead of local elections that could see the ruling African National Congress (ANC) lose support.
South Africa's top court on Thursday (local time) held that Zuma had failed to uphold the constitution by ignoring instructions to pay back some of the $US16 million (NZ$23.21 million) in state funds spent on renovations at his sprawling residence at Nkandla.
In a televised address to the nation on Friday evening, an apparently contrite Zuma apologised and said he would pay back some of the money, as ordered.
A report in 2014 identified a swimming pool, cattle enclosure, chicken run, amphitheatre and visitor centre as upgrades to the compound that were not related to security and that Zuma must pay for. Early estimates suggest he will have to pay about US$680,000.
"I wish to emphasise that I never knowingly or deliberately set out to violate the constitution," Zuma said.
"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 and confusion" caused by the scandal.
Zuma, who has an earthy manner and can be combative in the political arena, looked shaken at times and his tone throughout was sombre.
It was a sharp contrast to his past utterances on the issue, including one in parliament where he mocked the way non-Zulu members of the house pronounced "Nkandla."
Opposition parties, who have been calling for the 73-year-old to resign, dismissed his remarks.
"The president is misleading South Africa. He said repeatedly he always wanted to pay. He never wanted to pay," Democratic Alliance leader Mmusi Maimane told Reuters after the televised address.
The opposition has launched impeachment proceedings against Zuma but these are unlikely to be successful because of the ANC's strong majority in parliament.
However, some South Africans believe the scandal could still bring Zuma down by persuading some in the ANC, which has run South Africa since the end of apartheid in 1994, to abandon him.
ANC Secretary General Gwede Mantashe quashed that speculation, telling a news conference after Zuma's address that the party's top leadership was united behind its leader.
He also accused the opposition of over-reacting in their calls for Zuma's impeachment, adding that the party was weary of external attempts to get it "to tear itself apart" over Nkandla.
The rand, which has been pummelled since December by a string of Zuma-related scandals, was 1 percent stronger against the US dollar as Zuma started to speak but fell back as market speculation he might resign diminished.