Habib Bourguiba who died on April 6th aged 97, was the architect of modern Tunisia, one of the last of a generation of leaders to take his people from colonialism to independence. But the once dynamic reformer declined into a senile, capricious ruler.
After dominating the North African state for over three decades, he finally lost power in November 1987 at the age of 84, when his prime minister, Zine al Abidine Ben Ali, declared him unfit to continue ruling.
It was an ignominious end for the man who, as a young lawyer and politician, did more than anyone to hasten the end of the French protectorate in Tunisia. Tunisians, who greeted Habib Bourguiba with adulation when he returned from exile in France in 1955, breathed a sigh of relief in 1987 when the era of the "Supreme Fighter", his nickname, ended without bloodshed.
Shorn of power, he lived as a recluse in a guarded state residence in his native city of Monastir, where he was authorised to receive only members of his family and, from time to time, some Tunisian or foreign friends.
After Tunisia won independence, he introduced the personal status code - still the most progressive law governing the rights of women in the Muslim world.
He gave women the vote, abolished polygamy, forbade marriage under the age of 17 and gave women equal rights to divorce.
He discouraged the Muslim practice of fasting during the month of Ramadan, saying "the greatest Jihad is to fight for development". His name will also remain associated with a secular state education system.
President-for-life from 1975, Habib Bourguiba, asked about the Tunisian system, once replied: "What system? I am the system."
He excluded his opponents from political life until 1981.
Born in coastal Monastir at the turn of the century, he was the youngest of eight children of an army officer. His official year of birth was 1903 but he himself has said he may have been born between 1900 and 1902.
He was educated at the Sadiqi college and Lycee Carnot in Tunis before going to Paris to study law and politics.
He returned home in 1927 to become a lawyer but entered politics by writing for the Voice of Tunisia, mouthpiece of the Destourian Party, the main political movement agitating for Tunisian independence from France.
In 1934 he and other nationalists split with the party, set up the New Destourian Party and founded the newspaper L'Action Tunisienne, which survived until 1987 as a leading daily.
The French protectorate authorities arrested him three times between 1934 and 1952. Once, in 1943, he was freed by occupying German forces.
After the war he proclaimed an armed struggle to pressure for independence and was arrested and jailed in France while Tunisian guerrillas waged a liberation war in the mountains.
France eventually recognised him as the politician with whom to negotiate. He returned to a hero's welcome, became prime minister on independence in 1956 and president a year later when the traditional ruler, Bey Lamine, was deposed and the monarchy abolished.
He practised a moderate form of secular socialism at home and a pro-Western, anti-Communist policy abroad.
Relations with Arab states were often difficult, especially with Libya after Muammar Gaddafi's radical coup in 1969, and this encouraged him to look northwards to Europe.
In 1981, he announced the first multi-party elections since independence but the opposition alleged widespread fraud, later confirmed by the then prime minister, Mohamed Mzali.
When the courts failed to sentence Islamic leader Rashed Ghannouchi to death for treason, Habib Bourguiba demanded he be tried again and executed as soon as possible.
It was in this highly charged atmosphere that Zine al-Abidine Ben Ali, an army general and prime minister for only six weeks, decided to move against him and have a group of doctors declare him senile and unfit to rule the country.
In 1927 he wed - and subsequently divorced - a French war widow, Mathilde, who bore him a son, Habib Junior, who has held many cabinet and banking posts.
In 1962 he married Wassila Ben Ammar, who became an influential figure behind the scenes for 25 years. She was banished in 1986 and a presidential communique said he was divorcing her for violating the constitution by making political statements without his knowledge or approval.
Wassila Ben Ammar who died last year, had spoken out for democratising the constitution. She and Habib Bourguiba had no children.
Habib Bourguiba is survived by his son, Habib Bourguiba Junior.
Habib Bourguiba: born 1903; died April, 2000.