The chant "Pay back the money" filtered into South Africa's highest court on Tuesday, as judges heard a case in which President Jacob Zuma is accused of violating the constitution in a scandal over state spending on his private home.

Inside court, lawyers argued before 11 judges over whether the president broke the law by failing to follow a 2014 recommendation from the state watchdog agency that he pay back some of the more than $20 million in security upgrades to his rural home.

Outside, several thousand opposition party supporters demonstrated against what they described as corruption by the head of state, shouting that he should return state money used to improve his private home.

Zuma's office, on Feb. 3, said he was willing to reimburse some money, an about-turn to his previous position that he did nothing wrong. His critics said he was trying to avoid the embarrassment of a court hearing and a repeat of last year's heckling during his State of the Nation address, to be held on Thursday.

"The president's capitulation is gratifying but it is not enough," said Wim Trengrove, a lawyer for the opposition, adding that the president was "pushed into a corner" after two years of legal wrangling.

Opposition parties, the Democratic Alliance and the Economic Freedom Fighters, insisted on forging ahead with the court case, saying it would set a precedent for the accountability of future presidents. Much of the day's arguments hinged on the legal powers of the Public Protector, one of several oversight bodies created according to South Africa's 1996 constitution. Copies of the constitution were seen throughout the courtroom and were frequently consulted by those in the packed room.

The National Assembly, dominated by Zuma's party, the African National Congress, is also under scrutiny for failing to hold the president to account, because a parliamentary committee absolved the president of wrongdoing. The ministry of police released a similar report, arguing that the upgrades were essential security features. Grilled by the Constitutional Court justices, lawyers representing the president and the National Assembly acknowledged that both reports were questionable, but they would not concede that their clients breached the constitution.

Zuma's lawyer, Jeremy Gauntlett, said opposition parties were using the Constitutional Court hearing to strengthen a possible case of impeachment, extending a saga "which has traumatized the nation in many ways."

Zuma's presidency does not appear to be under immediate threat. Parliament has the power to remove him but Zuma retains support of the ruling African National Congress, which has backed Zuma's stance in the scandal over his private compound, known as Nkandla.

Judgment was reserved in the case. It is not yet known when the justices will announce their ruling.