South Africa's last apartheid president FW de Klerk died today leaving a final apology for crimes against other ethnic groups during decades of apartheid.

"I, without qualification, apologise for the pain and the hurt and the indignity and the damage that apartheid has done to black, brown and Indians in South Africa," said Mr de Klerk, who had previously expressed regret several times for the 1948-91 policy.

He died aged 85 at his home in Fresnaye after a battle with cancer.

Mr de Klerk headed South Africa's white minority government until 1994, when Nelson Mandela's African National Congress party swept to power.

He shared the Nobel Peace Prize with Mandela in 1993, but his role in the transition to democracy remains highly contested more than 20 years after the end of apartheid.

De Klerk was diagnosed in March with mesothelioma, a cancer that affects the tissue lining the lungs.

"Allow me in this last message to share with you the fact that since the early 80s, my views changed completely. It was as if I had a conversion," De Klerk said in the video message released by his foundation hours after his death.

"And in my heart of hearts, I realised that apartheid was wrong. I realised that we had arrived at a place which was morally unjustifiable," he said, adding that action was then taken to negotiate and restore justice.

A still image from FW de Klerk's last message

It was not immediately clear when the recording was made.

In the video, De Klerk also cautioned that South Africa faced many serious challenges, including what he called an undermining of the constitution.

President Cyril Ramaphosa paid tribute to De Klerk's role in South Africa's transition to democracy.

"He took the courageous decision (as president) to unban political parties, release political prisoners and enter into negotiations with the liberation movement amid severe pressure to the contrary from many in his political constituency," he said.

Mandela's foundation said De Klerk would "forever be linked to Nelson Mandela in the annals of South African history".

Complex legacy

Many blacks were angered by De Klerk's failure to curb political violence in the turbulent years leading up to the 1994 elections, while right-wing white Afrikaners, who had long ruled the country under the National Party, viewed him as a traitor to their causes of white supremacy and nationalism.

The foundation of Archbishop Desmond Tutu, a veteran of the struggle against white minority rule and seen by many as the nation's moral conscience, said De Klerk had "occupied an historic but difficult space in South Africa".

He had seen the necessity of change and "demonstrated the will to act on it," it added.

John Steenhuisen, leader of the Democratic Alliance (DA), South Africa's second biggest party after the ANC, said his success in bringing most white voters with him over the need to abolish apartheid helped ensure the transition was peaceful.

The DA is the main rival of the ANC but has struggled to shed its image as a party of white privilege.

Julius Malema, who heads the Marxist Economic Freedom Fighters (EFF), the country's third biggest political party, was much more critical, saying De Klerk should be referred to not as a "former president" but as a "former apartheid president".

Though long retired from active politics, De Klerk prompted anger among supporters of then President Jacob Zuma in 2016 when he accused them and their leader of seeking to advance their personal interests and of endangering democracy.

Mr De Klerk again drew criticism last year when he told a national broadcaster that he did not believe apartheid was a crime against humanity, as declared by the United Nations.

The backlash forced De Klerk to withdraw from a virtual seminar in the United States, where he had been due to speak on minority rights and racism.

De Klerk ensured his place in history when on 2 February 1990, he announced Mandela's release from 27 years in jail and lifted the ban on black liberation movements, effectively declaring the end of white-minority rule.

"I would hope that history will recognise that I, together will all those who supported me, have shown courage, integrity, honesty at the moment of truth in our history. That we took the right turn," Mr De Klerk said.

Twenty years after that speech, De Klerk said freeing Mandela had "prevented a catastrophe".

Frederik Willem de Klerk was born in Johannesburg on 18 March 1936.

His father, Jan de Klerk, was a minister in the National Party (NP) government that instituted apartheid. His uncle, JG Strijdom, was a prime minister notorious for stripping mixed race people of voting rights.

FW de Klerk followed in their footsteps. After practising law for 11 years, he won a seat in parliament for the NP in 1972 and climbed the political ladder through cabinet until he became the party's leader in February 1989.

Just six months later, after PW Botha was forced to resign, De Klerk became president of South Africa.

"When he became head of the National Party, he seemed to be the quintessential party man, nothing more and nothing less," Mandela wrote of him.

"Nothing in his past seemed to hint at a spirit of reform."

Negotiated end to apartheid

Yet Mandela sensed an opening and sent him a letter outlining a negotiated end to apartheid.

Less than two months later, De Klerk announced Mr Mandela's unconditional release and the end of the ban on the African National Congress.

FW de Klerk and Nelson Mandela seen at the end of a 3-day 'talks about talks' between the South African government and the ANC in 1990

De Klerk helped negotiate a new constitution, transforming South Africa into a non-racial democracy. He served for two years as Mr Mandela's deputy.

Despite relinquishing power and ushering in democracy, Mr De Klerk never moulded to the new South Africa.

He appeared before the Truth and Reconciliation Commission, apologising for apartheid. He also stormed out and accused the panel of bias.

As Mandela became a global icon, Mr De Klerk in a 2012 speech insisted: "He was by no means the avuncular and saint-like figure so widely depicted today."

In his later years, Mr De Klerk called on the ANC government to take accountability for rampant poverty and joblessness.

De Klerk and his first wife, Marike, who married in April 1958, had three adopted children.

The couple divorced in 1998 after he admitted to an affair with Elita Georgiades, the wife of a Greek shipping tycoon. They married the same year.