South Africa's last non-executive state president, Marais Viljoen, died on Thursday.

Viljoen, who had the mostly ceremonial role as the country's state president from 1979 to 1984 before P W Botha was elected to the post died in Muelmed Hospital in Pretoria due to heart failure.

He was 91.

Viljoen was born on a farm near Robertson in the Cape on December 2, 1915 but had a difficult childhood and was orphaned at the age of four.

Lack of money forced him to leave school before matriculating but later finished his matric through private study and started a career with the Post Office as a telegraphist.

He later moved on to become a reporter for Die Transvaler, a newspaper edited by H F Verwoerd, the man who later gave him his first cabinet position.

In 1940 he married Marietjie Viljoen who died in 2005 after a short illness.

"My father was devastated by her death and his health had deteriorated since," his daughter Elna Meyers told Sapa on Friday.

Viljoen was elected to Parliament in 1953 and in 1958 became the deputy minister of labour and mines.

He later became the Minister of Labour. He also held position as minster of mines, public works and post and telecommunications.

Viljoen was president of the Senate from 1976 until he was elected as state president.

Although actively supporting the National Party's policy of apartheid he was seen as a moderate within the party.

"My father was not as combative as others he was more diplomatic and tried to build relationships," Meyers said.

She said although her father retired from politics in 1984 when P W Botha became state president he was fascinated by politics right up until his death. He also enjoyed reading.

Viljoen leaves his daughter and a grandson. - Sapa