South African President Jacob Zuma on Friday apologized for a scandal over millions of dollars in state spending on his private residence and said he would abide by a Constitutional Court ruling that he should pay back some funds.

In a nationally televised address, Zuma said he acted "in good faith" in the long dispute over his Nkandla home, which fueled concerns about alleged corruption at the highest levels of government as well as opposition calls for the president to resign.

"The matter has caused a lot of frustration and confusion for which I apologize on my behalf and on behalf of government," Zuma said.

The speech was unlikely to curb an opposition move to impeach Zuma after South Africa's top court said he had violated the constitution by not adhering to recommendations by a state watchdog agency that he should pay back some of the more than $20 million spent on his compound.

However, impeachment requires a two-thirds majority in a parliament where the ruling African National Congress party has a comfortable majority and has already defeated a no-confidence motion against Zuma this year. The Constitutional Court also ruled Thursday that parliament failed in its obligations by not holding Zuma to account in the spending scandal.

Under the court's ruling, the national treasury must calculate costs of upgrades unrelated to security at Zuma's home within 60 days, and the president must repay that amount within 45 days thereafter. Those upgrades include a swimming pool and a chicken run.

"I wish to emphasize that I never knowingly or deliberately set out to violate the constitution, which is the supreme law of the republic," Zuma said.

Mmusi Maimane, leader of the main opposition party, the Democratic Alliance, said earlier Friday that ruling party lawmakers should act against Zuma if their professed respect for the constitution is genuine.

"If you are serious about that, then you can't have Jacob Zuma," Maimane said.

In a separate scandal, Zuma has been accused of allegedly improper links to the Guptas, a wealthy business family whose business associates include Zuma's son Duduzane. The president dismissed allegations that the Guptas played a role in selecting some Cabinet ministers, but other leaders of the ruling party have harshly criticized the family.

___

Follow Christopher Torchia on Twitter at www.twitter.com/torchiachris