Jacob Zuma is the most colourful and controversial president South Africa has had since white-minority rule ended in 1994.
He has been a politician of nine lives, surviving a series of scandals which would surely have ended anyone else's career.
But Mr Zuma, the man born into poverty who went into exile to fight apartheid before rising to become "the people's president", could only hold on for so long.
He was facing his ninth vote of no-confidence in parliament before he left office, forced out by his own party – the African National Congress (ANC).
And those charges of corruption – always vehemently denied – finally caught up with him. In April 2018, he was charged for alleged fraud and racketeering linked to a 1999 arms deal.
For many years, it was unwise to write Mr Zuma off: his Zulu name, Gedleyihlekisa, means the one who smiles while grinding his enemies.
image copyrightReutersimage captionCyril Ramaphosa (left) replaced Mr Zuma as ANC leader
He did not leave power without a fight but carried on long after the writing was on the wall, reportedly negotiating his departure.
After all, long before he became President Zuma, and "Nkandla" and "state capture" had entered the everyday lexicon of South Africans, his lawyers were already busy.
image copyrightAFPimage captionMr Zuma is reputed to be a good dancer
Mr Zuma's bid for the presidency was written off before he had even really started.
In the run-up to the 2009 election, he was simultaneously battling allegations of rape and corruption.
He was acquitted of raping an HIV-positive family friend in 2006 – although the fact he told the court he had showered in order to avoid catching HIV would continue to haunt him throughout his presidency.
- Zuma: A president of many trials
- How Jacob Zuma's presidency shaped South African speech
- The Guptas and their links to Zuma
- South Africa's anti-corruption crusader
- How Zuma's Nkandla home has grown
The arms deal corruption case proved harder to shake off, however, even after it was controversially dropped by the National Prosecuting Authority (NPA) just weeks before the elections which saw him become president.
In 2017 the supreme court ruled that 18 counts of corruption should be reinstated.
Now a trial court will be asked to decide on his guilt or otherwise – but on 16 charges instead of 18.
'The people's president'
It was his charisma which swept Mr Zuma to power in 2009. His supporters saw his popular touch as a refreshing contrast to then President Thabo Mbeki, who was seen as a rather aloof president.
"He is a man who listens; he doesn't take the approach of an intellectual king," said one unnamed supporter, in an apparent swipe at Mr Mbeki, whose allies were accused of spearheading Mr Zuma's prosecution after he had wrested control of the ANC in 2007.
Mr Zuma's modest upbringing and promotion of traditional family values are also seen as a major factor in his long-lived popularity among many poor South Africans, especially in rural areas.
image copyrightAFPimage captionMr Zuma's home in Nkandla has caused him a big political headache
The 75-year-old is a proud polygamist – following a Zulu tradition – and currently has four wives. He has been married six times in total, and has 21 children. One of his wives, Mozambican Kate Mantsho, took her own life in 2000.
However, he is also known for his infidelity and has fathered a child with another woman.
It wasn't long until people were questioning his carefully crafted "people's president" image. By 2013, it lay in tatters following the upgrading of his residence in the rural area of Nkandla, in northern KwaZulu-Natal, using state funds.
By the time of the memorial for South Africa's first black president, Nelson Mandela, in December of that year, ANC supporters were openly heckling and booing him in front of foreign dignitaries – including US President Barack Obama.
"He is eating when we are hungry," one protester said, capturing the public anger over the Nkandla upgrade, which came complete with cattle enclosure, amphitheatre, swimming pool, visitor centre and chicken run.
Three years later, South Africa's highest court ruled that he had violated the constitution by failing to repay the government for money used on upgrading his private residence.
The president apologised to South Africans for the "frustration and confusion" caused by the scandal and has repaid the money.
But the Nkandla controversy was destined to be overtaken by a scandal of even larger proportions: State capture.
Zuma's legal woes: image copyrightGetty Images
- 2005: Charged with raping family friend – acquitted in 2006
- 2005: Charged with corruption over multi-billion dollar 1999 arms deal – charges dropped shortly before he becomes president in 2009
- 2016: Court orders he should be charged with 18 counts of corruption over the deal – he appealed, but in 2017 lost a bid to overturn them
- 2016: Court rules he breached his oath of office by using government money to upgrade private home in Nkandla – he has repaid the money
- 2017: Public protector said he should appoint judge-led inquiry into allegations he profiteered from relationship with wealthy Gupta family – he denies allegations, as have the Guptas
- 2018: Zuma approves inquiry into claims of state looting
- 2018: The National Prosecuting Authority confirms Mr Zuma will face prosecution for 12 charges of fraud, one of racketeering, two of corruption, and one of money laundering
Focus soon turned to Mr Zuma's relationship with the wealthy Indian-born Gupta family amid allegations they had used it to influence cabinet appointments and obtain lucrative government contracts.
Both Mr Zuma and the Guptas have denied the allegation, but the ANC ordered an investigation into what its secretary-general Gwede Mantashe has called the "corporate capture" of government.
In January 2018, Mr Zuma approved a judge-led inquiry into the allegations.
media captionAndrew Harding reports on allegations of high-level corruption in South Africa involving a British PR companyHumble beginnings
The scene of one of his greatest scandals was also the place of his birth. Mr Zuma was born in Nkandla on 12 April 1942. Brought up by his widowed mother, he had no formal schooling.
Later, aged 17, he would join the ANC, becoming an active member of its military wing, Umkhonto We Sizwe, in 1962.
image copyrightAFPimage captionMs Dlamini-Zuma is seen as a potential successor to Mr Zuma
- Gertrude Sizakele Khumalo (married in 1973)
- Nompumelelo Ntuli (2008)
- Thobeka Madiba (2010)
- Gloria Bongi Ngema (2012)
- Nkosazana Dlamini-Zuma (married in 1972; divorced in 1998)
- Kate Mantsho (married in 1976; died in 2000)
He was convicted of conspiring to overthrow the apartheid government and imprisoned for 10 years on the notorious Robben Island, alongside Nelson Mandela.
Mr Zuma is said to have helped keep up morale among the incarcerated ANC grandees with songs and impromptu theatre – it was that comical nature which endeared him to ordinary South Africans before his elevation to the presidency.
After being freed from prison, Mr Zuma left South Africa, living first in Mozambique, then Zambia, as he rose through the ANC ranks to the executive committee.
He became one of the first leaders to return home in 1990 – when the ban on the ANC was removed – to take part in negotiations with the white-minority government.
While trying to oust Mr Mbeki, he enjoyed strong support among trade unionists and the communist party – an ANC ally – as they believed he would redistribute South Africa's wealth in favour of the poor.
But under Mr Zuma, the economy remained moribund and unemployment rate rose to about 28%, while almost daily protests were held by people demanding better basic services such as housing, schools, water and electricity.
After he had been in power for just a few years, many of his erstwhile allies, such as firebrand youth leader Julius Malema, dropped him, accusing the man known as "JZ" of not doing enough to help the poor.
image copyrightAFPimage captionOpposition parties have challenged him on the streets and in the courts
Of course, there have been victories for Mr Zuma.
As president he won over many critics and activists when he announced a major overhaul to the country's Aids policy in December 2010 – this has seen a drastic increase of the roll-out of life-saving anti-retroviral (ARV) drugs.
South Africa has an estimated five million people living with HIV, more than any other country.
His former ally Mr Malema, and his Economic Freedom Fighters (EFF) party, were behind many of the attempts to topple the president.
And after his ex-wife, Nkosazana Dlamini-Zuma – widely seen as the continuity candidate – failed in her bid to succeed him as leader of the ANC, losing to Cyril Ramaphosa in December 2017, they appeared to smell blood.
A ninth motion of no-confidence was filed days before Mr Zuma was due to give the annual State of the Nation address in February 2018.
Meanwhile, Mr Ramaphosa – favourite to follow in Mr Zuma's footsteps – and the party's top brass had been meeting, apparently preparing to unseat Mr Zuma and shake the party free of corruption allegations ahead of the 2019 election.
In the end, what many South Africans had wanted for years finally happened – Zexit.