PW Botha, who has died aged 90, ruled South Africa under apartheid for 11 years until 1989, and was gradually exposed during his long decline as one of the most evil men of the 20th century, committed to state terrorism, war and murder to thwart black majority rule.

The October 1998 report of the post-apartheid Truth and Reconciliation Commission, before which Botha refused to appear, earning a conviction for contempt, said he had been responsible for "gross violations of human rights". As prime minister from 1978 to 1984, and then state president until 1989, he was also chairman of the State Security Council, and made remarks "in its meetings and recommendations that were highly ambiguous and were interpreted as authorising the killing of people".

According to the commission, he took no action against government agents who carried out atrocities, and supported covert operations "destabilising the governments of neighbouring countries". He also ordered police to blow up the Johannesburg offices of anti-apartheid groups. The nickname "Great Crocodile" was hard-earned.

Pieter Willem Botha was born in Bethlehem in the Orange Free State, where his father, a "bitter-ender" who had fought the British to the last gasp of the Boer war, was a horse farmer. His mother was interned in one of Lord Kitchener's concentration camps and the young PW, as he was usually known, inherited the sour, bullying, anglophobic obduracy that became his trademark from his parents.

He joined the pro-Nazi "Ossewabrandwag" movement in 1939, but, never over-burdened with moral courage, found it too risky and left after two years, avoiding internment. A politician all his adult life, Botha was already active in the Afrikaner National Party (NP). He became MP for the Cape Province constituency of George when the NP won power in the white electoral landslide of 1948. It sustained Afrikaner political domination until ousted by Nelson Mandela's African National Congress (ANC) in 1994.

The qualities he showed in support of his ambition included ruthlessness, organisational efficiency, discipline and a liking for hard work (he was still doing a 12-hour day in his 70s). This won the attention of the messiah of apartheid, Dr Hendrik Verwoerd, who made him a deputy minister in 1958.

His first full departmental post was as minister for community development and coloured affairs from 1961. As such, he was paternalistically responsible for the coloured racial group, in apartheid terms those of ethnically mixed origin, concentrated mainly in Cape Province. As an adoptive Cape politician, Botha always prided himself on his special feeling for the coloureds. This did not prevent him from ordering the demolition, as a blight on the city, of Cape Town's coloured quarter, District Six.

As District Six fell, so did Verwoerd, assassinated by an alleged madman in 1966 and succeeded by "iron man" John Vorster, who promoted Botha to minister of defence. This cherished promotion precipitated a lifelong love of the military, including acts of war and covert operations at home and abroad.

Botha brought South Africa close to self-sufficiency in weaponry, circumventing the UN arms embargo where import substitution failed. The state-owned arms corporation produced cannon that were regarded as the best of their kind. Major warships, the latest aircraft and helicopters were beyond reach, but three small submarines were acquired from France, while Israel proved a surprisingly willing partner in such joint enterprises as missiles - and nuclear technology. When the US secretly backed the increasingly blatant South African interventions in the Angolan civil war against the FPLA government backed by Cuban troops, Botha was able to acquire munitions and spares in cornucopian quantities.

When Vorster was kicked upstairs as non-executive state president in 1978 in the wake of the "Muldergate" corruption scandal, the NP felt the same need for a strong man as it had when Verwoerd died. Who better to face the "total onslaught" by communists and blacks than the man who had built up the strongest military power in Africa - even if his power-base was the Cape NP rather than Verwoerd's Transvaal?

Botha soon stunned everyone by pronouncing apartheid dead. "Adapt or die" became his watchword as he foreshadowed "reform" without precedent. The world fondly imagined he would abolish discrimination as he became the first South African leader to visit Soweto, Johannesburg's south-western township, and travelled abroad more than any of his NP predecessors. However, the furthest he was prepared to go was to shift the great divide in South African politics from between white and non-white to between non-black and black.

But progress could not be stemmed altogether. One of the most important changes under Botha's leadership was the legalisation of black trade unions in 1979, giving African industrial labour a real voice. "Petty" apartheid (anything but petty to its victims) was radically cut back: the fatuous laws banning marriage and sex between different races were repealed, the notorious pass laws, the British legacy that controlled the movements of Africans, and the ban on black freehold ownership were also scrapped.

But residential and educational segregation and racial classification were retained. In 1983, under loudly trumpeted constitutional reform proposals, the coloured and Asian minorities were given their own separate chambers in parliament. Black political rights, however, were to be enshrined in their tribal "homelands" as conceived by Verwoerd. "Grand apartheid" was adapting, but only so as not to die.

The urban black population erupted, especially the young, as the reforms came into force in 1984, when Botha elevated himself to executive president. Only after tens of thousands had been arrested and 2,500 killed in confrontations with trigger-happy police under a permanent state of emergency was the lid forced back on the simmering townships.

The outside world lost patience as the domestic concessions backfired and the customarily apoplectic Botha took the view that the west was moving the goalposts on the urging of communistic liberals and black opinion. He decided on one more try, in a televised speech heavily telegraphed as all but revolutionary, on August 15 1985. He announced in a live worldwide broadcast that he was "crossing the Rubicon".

In fact, after a short attempt at walking on water, he returned to where he had started. Even the assiduously sympathetic Mrs Thatcher now gave up on Botha, the rest of whose time in office was marked by inertia. Nothing more could be expected from an authoritarian politician with a violent temper whom nobody dared to cross.

Even a secret meeting with Nelson Mandela, still the inspiration of the ANC after 25 years in jail, bore no fruit through Botha's intransigence.

Urged on by astutely mobilised black American opinion, US banks and corporations began to divest themselves of holdings in South Africa. This commercially motivated boycott was the undoing of apartheid: the rand's value collapsed. Botha was forced under US pressure to concede independence to Namibia amid military setbacks in Angola and growing economic problems.

The manifest intellectual bankruptcy of his last few years should not obscure the political cunning and manipulative successes of his heyday. He was consistently underestimated by foreigners, who forgot that, as an Afrikaner, Botha was speaking a second, unloved language when he used his slow English as a blunt instrument, uttering such sentences as "Don't push us too far," in an accent thick with naked menace. He carried a big stick but did not speak softly.

After a stroke in January 1989, Botha threw away his power-base by quitting as NP leader while staying on as president, apparently seeking to rise above mere politics. The Transvaaler FW de Klerk took over the NP, and, in a brutal power struggle, provoked Botha's resignation in August.

In an extraordinary farewell address on television, a frail but seething Botha, his hands trembling, accused the cabinet of failing to inform him of de Klerk's plan to visit Zambia, and of playing into the hands of the ANC, which had bases there. De Klerk and ministers insisted that Botha had been kept informed, with the unmistakable implication that he was senile.

A year later the apartheid log-jam broke as de Klerk released Mandela under unrelenting international pressure. The two men warily shared power until a free election gave the ANC a handsome majority, and apartheid officially came to an end in 1994.

Botha at first chose obscurity, retiring to the well-named coastal resort of Wilderness on the coast 300 miles east of Cape Town. But when the Truth and Reconciliation Commission, led by Archbishop Tutu, summoned him to give evidence on abuse of power during his time in office, Botha refused point-blank.

He became an object of ridicule at the age of 81, three months after his beloved wife, Elize, died in 1997 (they had two sons and three daughters), when he became engaged to a 46-year-old white traffic warden and double divorcee. He later ditched his Afrikaner fiancée in favour of an Englishwoman aged 57.

He continued to defy the subpoena and in January 1998, was hauled up before a black magistrate on a charge of contempt of court. Meanwhile, one witness after another told the commission of the involvement of Botha's government in all manner of crimes against its opponents.

In June 1998, the contempt case at last went ahead and a former police colonel, Eugene de Kock, a licensed killer under apartheid, attested how he had carried out bombings in Johannesburg and London on Botha's orders. Botha refused to give evidence.

Eventually he was fined 10,000 rand (nearly £1,000) and sentenced to one year's imprisonment, suspended for five years. This meant that another refusal to appear or testify would mean jail; but, as the commission issued its report in October 1998, there seemed to be no point in pursuing the old man any further.

The revelations of the depths to which the apartheid regime had sunk under Botha continued, including government research in the early 1980s aimed at finding chemical and biological agents that worked only against blacks. Although its two-year mandate expired before it could get to the bottom of this, the commmission got wind of the research in its final weeks. It was already known to western drug companies and intelligence services - which kept silent, their only concern apparently being to stop the results being passed to the ANC when it took over government.

In a rare public statement during his 1998 court battle, an unreconstructed Botha showed his customary obduracy: "I stand with all those who executed lawful government commands in our struggle against the revolutionary communist onslaught against our country ... I am not prepared to apologise for actions which I took to remove (sic) racial discrimination in this country [or] for lawful actions of my government in its struggle to curb the violent onslaught."

The jibbering, trembling Great Crocodile, exposed at last as one of the worst tyrants of a bloodsoaked century, had clearly learned nothing and forgotten nothing.

South Africa's post-apartheid constitution provides for a state funeral for former presidents. Those familiar with Botha's character and political record may view this as a bitter irony. His second wife and five children survive him.

· Pieter Willem Botha, politician, born January 12 1916; died October 31 2006