South Africa's former President Jacob Zuma has handed himself in to police to begin serving a 15-month jail sentence for contempt of court.
He was admitted to Estcourt Correctional Centre in his home province of KwaZulu-Natal on Wednesday.
Police had warned that they were prepared to arrest him if he did not hand himself in by midnight.
Zuma, 79, was handed the jail term last week after he failed to attend a corruption inquiry.
The sentencing sparked an unprecedented legal drama in South Africa, which has never seen a former president jailed before.
Zuma had initially refused to hand himself in, but in a short statement on Wednesday, the Jacob Zuma Foundation said he had "decided to comply".
His daughter, Dudu Zuma-Sambudla, later wrote on Twitter that her father was "en route [to the jail] and he is still in high spirits".
Zuma was sentenced on 29 June for defying an instruction to give evidence at an inquiry into corruption during his nine years in power. He has testified only once at the inquiry into what has become known as "state capture" - meaning the siphoning off of state assets.
Businessmen have been accused of conspiring with politicians to influence the decision-making process while he was in office. But Zuma has repeatedly said that he is the victim of a political conspiracy.
In a separate legal matter, Zuma pleaded not guilty last month in a corruption trial involving a $5bn (£3bn) arms deal from the 1990s.
More about Jacob Zuma:
Though he was forced out of office by his own party in 2018, the African National Congress (ANC), he retains a loyal body of supporters, especially in his home province of KwaZulu-Natal.
On Sunday, crowds formed what they called a human shield outside Zuma's palatial home in an effort to prevent his arrest. Similar crowds gathered before he handed himself in on Wednesday.
An ignominious end
Analysis by Farouk Chothia, BBC News
Zuma was once an illustrious political figure, who was jailed for fighting the racist system of apartheid in South Africa.
Now, he has been arrested for being contemptuous of South Africa's most senior judges - the guardians of the democracy he fought for - as he tried to evade accountability over the deluge of corruption allegations he faced during his presidency.
It is an ignominious end to Zuma's political career, but a proud moment for South Africa's democracy. It shows that no-one is above the law - not even a former president.
His supporters threatened to block any attempt by police to arrest him, but in the end they did not have to. The 79-year-old surrendered, knowing he could not defeat the might of the state.
The BBC's Nomsa Maseko, who was outside Zuma's home on Wednesday, noted that there was a large police presence outside the property that included armed officers and a paramilitary unit.
A delegation of senior officers are believed to have spent several hours inside the residence negotiating with the former president over his arrest.
A convoy of cars, one of which was carrying Zuma, was then seen leaving the house at high-speed shortly before the midnight deadline for his detention.
Zuma previously declared that he was prepared to go to prison.
However, he said that "sending me to jail during the height of a pandemic, at my age, is the same as sentencing me to death".
Zuma's legal woes:
- 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, relating to the arms deal, which he denies
- 2021: Begins a 15-month jail sentence after the Constitutional Court orders his arrest for refusing to testify at the commission into state looting