Botha died at his home on the southern Cape coast at 8 p.m., according to the South African Press Association. "Botha died at home, peacefully," Capt. Frikkie Lucas was quoted as saying.
The African National Congress issued a statement expressing condolences and wishing his family "strength and comfort at this difficult time."
Nicknamed "Pik" and known as the "Old Crocodile" for his feared temper and sometimes ruthless manner, Botha served as head of the white racist government from 1978 to 1989.
Throughout his leadership he resisted mounting pressure to free South Africa's most famous political prisoner, Nelson Mandela. Mandela was released by Botha's successor, F.W. de Klerk in 1990.
Botha liked to depict himself as the first South African leader to pursue race reform, but he tenaciously defended the framework of apartheid, sharply restricting the activities of black political organizations and detaining more than 30,000 people.
Through a series of liberalizing moves, Botha sought support among the Asian and mixed-race communities by creating separate parliamentary chambers. He lifted restrictions on interracial sex and marriage. He met with Mandela during his last year as president.
But after each step forward, there was a backlash, resulting in the 1986 state of emergency declaration and the worst reprisals of more than four decades of apartheid.
Botha's intransigence on releasing Mandela led the anti-apartheid Johannesburg Daily, Business Day, to write: "The government is now the prisoner of its prisoner; it cannot escape his embrace."
Within a year after Botha stepped down, de Klerk released Mandela after 27 years in prison and put South Africa on the road to its first all-race elections in 1994, when Mandela became president.
In December 1997, Botha stubbornly resisted appearing before a panel investigating apartheid-era crimes. He risked criminal penalties by repeatedly defying subpoenas from the Truth and Reconciliation Commission to testify about the State Security Council that he headed.
The council was believed to have sanctioned the killing and torture of anti-apartheid activists, and the panel wanted to know what Botha's involvement was.
Born Jan. 12, 1916, the son of a farmer in the rural Orange Free State province, Botha never served in the military or graduated from college. He quit university in 1935 to become a National Party organizer.
During World War II, Botha joined the Ossewabrandwag (Ox Wagon Fire Guard), a group that was sympathetic to the Nazis and opposed South Africa's participation on the Allied side.
Botha won election to Parliament in 1948, the year the National Party came to power and began codifying apartheid legislation. He joined the Cabinet in 1961 and became defense minister in 1966.