South Africa: Jacob Zuma's five biggest career scandals

South African President Jacob Zuma, who was on Thursday excoriated by the country's highest court for failing to uphold the constitution, is no stranger to scandal.

In a public humiliation, the Constitutional Court berated him over taxpayers' money spent on his private home at Nkandla -- but Zuma has ridden out many similar storms in the past.

Here are five of his biggest career controversies:

Rape charges and aids

Before taking office, Zuma dismayed the nation during his trial for rape in 2006 when he told the court he had showered to avoid contracting HIV after having unprotected sex with his HIV-positive accuser.

He was head of the country's national AIDS council at the time.

Zuma claimed the sex with the 31-year-old family friend was consensual and was acquitted of rape.

But he is still mocked over the case in newspaper cartoons -- where he is often depicted with a shower nozzle sprouting from his bald head.

Nearly 20 percent of South Africans aged between 15 and 49 are HIV positive.

Guptagate

As the Nkandla debacle built to a climax, its place in the headlines was overtaken by a new scandal, known as Guptagate.

It involves the president's allegedly corrupt relationship with a wealthy family of Indian immigrants headed by three brothers, Ajay, Atul and Rajesh Gupta, who have built a business empire in mining, media, technology and engineering.

Smouldering rumours of the family's undue influence on the president burst into flame in March when evidence emerged that they were alleged to have offered key government jobs to those who might help their business interests.

Deputy finance minister Mcebisi Jonas revealed that the Guptas had offered him a promotion shortly before Zuma sacked respected finance minister Nhlanhla Nene in December.

The opposition Democratic Alliance (DA) has laid corruption charges against the Guptas and Zuma's son Duduzane, who is in partnership with the family.

The president was also alleged to have allowed the family to use a military airport to fly in guests for a wedding in 2013.

Arms deal

A High Court challenge is underway to reinstate more than 700 charges of corruption against Zuma which were dropped in 2009, shortly before he became president.

The charges, which relate to a multi-billion dollar arms deal signed in 1999, when Zuma was deputy president, were dropped allegedly because of interference in the prosecution case by his political opponents.

Zuma was accused of having accepted bribes from international arms manufacturers to influence the choice of weaponry.

Zuma's advisor, Schabir Shaik, was jailed for 15 years on related charges in 2005, with the judge saying there was "overwhelming" evidence of a corrupt relationship between Shaik and Zuma.

Shaik was released on medical parole in 1999, the year Zuma became president.

Omar al-Bashir

Earlier this month the South African Supreme Court of Appeal upheld a judgement that the failure by Zuma's government to arrest Sudanese President Omar al-Bashir was illegal.

Despite an arrest warrant from the International Criminal Court on charges of war crimes in the conflict in Darfur, Bashir was allowed to attend a meeting of the African Union in Johannesburg last year.

The government said the fact that he was attending the summit as a head of state meant he had immunity, but the court disagreed.

Zuma escaped an impeachment attempt over the issue in parliament in September last year, when ANC lawmakers voted overwhelmingly against it.

Nkandla

Public Protector Thuli Madonsela, the country's ombudswoman, ruled in 2014 that Zuma had "benefited unduly" from so-called security upgrades to his rural Nkandla residence in KwaZulu-Natal province, and that he should re-fund some of the money.

The work, paid for with taxpayers' money, cost $24 million and included a swimming pool, described as a fire-fighting facility, a chicken run, a cattle enclosure, an amphitheatre and a visitors' centre.

For two years, Zuma fought the order to repay some of the money and the scandal came to dominate his presidency -- with opposition lawmakers chanting "Pay back the money!" every time he appeared in parliament.