The first president of independent Algeria, Ahmed Ben Bella, who has died aged 95, did not remain long in office once he had achieved success in his fight against colonialism. However, after the long period of imprisonment and exile that followed his overthrow, he re-emerged in the 1990s as his country's voice of conscience.
Absorbed as a colony in 1847, Algeria was long regarded as part of metropolitan France. Ben Bella had been decorated for bravery by General Charles de Gaulle during the second world war. Yet Algerians were excluded from French politics, and any nationalist protest was stamped upon.
Born into a family of mountain peasants in Maghnia, on the Algeria-Morocco border, Ben Bella joined the nationalist Parti du Peuple Algerien while a 15-year-old. His political life began in earnest against the background of the French massacre of Algerian protesters at Sétif on VE day 1945.
In 1947 he and Hocine Aït Ahmed launched the secret paramilitary Organisation Spéciale (OS) with the aim of overthrowing the French. They raided a post office in Oran for funds in 1949, but Ben Bella was jailed and the OS crushed. He escaped in 1952 after sawing through his cell bars, and eventually found refuge in Cairo.
There, in March 1954, Ben Bella and eight other Algerian revolutionary leaders created the National Liberation Front (FLN). They maintained that "the only negotiation is war", and seven years of conflict ensued.
For two years Ben Bella shuttled between Egypt, Tunisia and Morocco, acquiring weapons and sending orders to fighters in the field. In October 1956 French agents captured him and four colleagues on board an airliner flying to Tunis, and detained them in France. The resultant schism between these external leaders and the local resistance was to blight Ben Bella's short presidency.
Released from prison in France in March 1962, after the Evian agreement between France and the provisional government of Algeria had ended the war, Ben Bella was elected president in September 1963. That year he passed Algeria's first constitution, encouraged the creation of Sonatrach, Algeria's national oil and gas conglomerate, and built schools for thousands of former shoeshine boys.
Yet public disillusion set in when Ben Bella began mismanaging the country. He spurned the FLN tradition of collective leadership by interfering in the jurisdiction of ministers and redistributing land through a corrupt bureaucracy, forcing out former allies one by one.
Backed by Houari Boumediene's force of 70,000 "external" FLN troops, he ousted Algeria's provisional prime minister, Ben Youssef Ben Khedda. In April 1963, Vice President Rabah Bitat resigned after accusing Ben Bella of betraying socialist principles, but soon went into exile. Another ex-comrade, Aït Ahmed, launched a rebellion in September 1963.
Boumediene unseated Ben Bella in June 1965, as the president tried to open negotiations with the rebels. European sympathisers detected the CIA's hand at work. Ben Bella was initially held incommunicado, but later under house arrest. He married Zahra Sellami, a journalist who had come to interview him, and the couple drew closer to Islam. While condemning the violent excesses of the Islamists, Ben Bella saw Muslim values as the surest guarantee of rights in Algeria.
Ben Bella was freed in July 1979, soon after Boumediene died. He moved to France in 1980, but in 1983 was expelled and went to Lausanne, Switzerland. There he launched Le Mouvement pour la Démocratie en Algérie (MDA) in May 1984, returning to Algeria in September 1990 to contest the nation's first multiparty elections.
The MDA portrayed itself as an alternative to the Islamist FIS and ruling FLN, but did poorly at the polls. A military council cancelled the electoral process after dramatic FIS successes and assumed power in January 1992. Ben Bella spearheaded the Rome Platform for restoring Algerian democracy in January 1995. His party boycotted the November 1996 constitutional referendum and was banned in 1997.
Ben Bella led campaigns in support of the Palestinian cause and against US foreign policy. However, his support for Saddam Hussein's invasion of Kuwait in 1990 sat uncomfortably with his belief in the inviolable rights of sovereign states. And Berbers in Algeria were unhappy about his pan-Arabism.
With Zahra he had adopted two daughters, Mahdiya and Nourriya.