The highest court in South Africa has ruled that President Jacob Zuma violated the constitution when he failed to repay government money spent on his private home.
It gave the treasury 60 days to determine how much he should repay.
The ruling is a victory for the opposition, who said they would push for Mr Zuma’s impeachment.
They accuse him of using “ill-gotten wealth” to upgrade his home with a swimming pool and amphitheatre.
Mr Zuma has denied any wrongdoing.
- More on this and other African news stories
- Zuma fights for his reputation
- Zuma’s ‘careless blunder’
A government statement said he would “reflect” on the judgement and take “appropriate action”.
An anti-corruption body, known as the public protector, ruled in 2014 that $23m (£15m) had been spent on his rural home in Nkandla in South Africa’s KwaZulu-Natal province.
Mr Zuma had “unduly benefited” from the renovations and should repay a portion of the money, the public protector said.
In a unanimous judgement on behalf of the Constitutional Court’s 11 judges, Chief Justice Mogoeng Mogoeng said the public protector was a “Biblical David” fighting against the Goliath of corruption.
Mr Zuma’s failure to repay the money was “inconsistent” with the constitution, he added.
“The president failed to uphold, defend and respect the constitution,” he declared.
Spending on presidents’ private homes
- PW Botha: $16,100
- FW de Klerk: $22,000
- Nelson Mandela: $2.9m on two residences
- Thabo Mbeki: $1.1m
- Jacob Zuma: $23m on rural Nkandla residence
All figures in 2013 financial terms
Source: Public protector report
The case was brought by two opposition parties, the Economic Freedom Fighters (EFF) and the Democratic Alliance (DA).
The EFF called on Mr Zuma to step down while the DA said it would table a motion in parliament to demand his impeachment.
Mr Zuma’s term in government has been marred by allegations of corruption and cronyism.
He was first elected in 2009 and is due to step down in 2019.
The governing African National Congress said it respected the ruling.
It has so far rejected growing pressure to force Mr Zuma out of office.