The former president of South Africa, FW de Klerk, has died after being diagnosed with cancer earlier this year.

As the last white person to lead the country, he ordered Nelson Mandela's release from prison, leading to historic polls where the anti-apartheid leader became the first Back president.

Coming to power in 1989 under apartheid, a system of legalised racism, he later became a key figure in the transition to democracy.

He later shared the Nobel Peace Prize with Mandela for helping to negotiate an end to apartheid. But his legacy divides opinion in South Africa.

Following his death, the FW de Klerk Foundation released a video recording - dubbed his "final message" - in which he talks about apartheid.

"Let me today, in the last message repeat: I, without qualification, apologise for the pain and the hurt, and the indignity, and the damage, to Black, Brown and Indians in South Africa," he says. The foundation said De Klerk had died peacefully at his home following his struggle against mesothelioma - a cancer that affects the lining of the lungs.

South African President Cyril Ramaphosa said: “F.W. De Klerk's death should inspire all of us to reflect on the birth of our democracy. After working for more than a decade as a lawyer, De Klerk won a parliamentary seat for the National Party, which had introduced the system of apartheid in 1948.”

De Klerk served in several ministerial posts before taking over as the head of the party in 1989 becoming president. He had been a firm believer in apartheid, but after coming to power he publicly called for a non-racist South Africa.

In a speech to parliament in 1990, he announced that he was removing the ban on parties that included Mandela's African National Congress (ANC) and said he was ordering Mandela's release from prison after 27 years. His actions helped bring an end to apartheid-era South Africa, and he became one of the country's two deputy presidents after the multi-party elections in 1994 that saw Mandela become president.

In a statement, the Nelson Mandela Foundation said that De Klerk would forever be linked to Nelson Mandela in the annals of South African history. De Klerk's legacy is a big one, as well as an uneven one, something South Africans are called to reckon with in the immediate future.

In his message, Mr Ramaphosa praised De Klerk for the role he played in South Africa's transition to democracy, despite what he reminded people of as “severe pressure to the contrary from many in his political constituency." South Africa's main opposition party, the Democratic Alliance, said De Klerk's contribution to the country's transition to democracy could not be overstated.

He was 85.