Historians will be grateful that Ahmed Ben Bella, who has died aged 95, survived into the year marking the 50th anniversary of Algeria's independence from France. Had he died any earlier, the country's first president might never have made it into the anti-colonialist pantheon inhabited by more likeable characters like India's Jawaharlal Nehru or Ghana's Kwame Nkrumah.
Ben Bella was hard-line and often intolerant. He had an autocratic streak and frequented all the wrong world leaders, like Fidel Castro, Saddam Hussein and Muammar Gaddafi. Such an irritant and danger was he to fellow Algerian politicians that he spent years expunged from the country's collective memory. But he unquestionably devoted his life to Algeria.
He was born in Maghnia, near the Moroccan border, to immigrant farmer parents who had come from Marrakesh. After completing secondary school he joined the French army in 1936. A skilled footballer, he briefly played in midfield for Olympique de Marseille. He served with the Free French Forces and was decorated by Charles de Gaulle for bravery at the Battle of Monte Cassino.
But a defining moment for Ben Bella came on 8 May 1945 when a Victory in Europe parade in the town of Sétif descended into a bloodbath as French gendarmes turned on marchers denouncing colonial rule. As many as 40,000 may have been killed in the following five days.
Ben Bella, a local councillor in Maghnia, moved into the radical underground. He joined the Organisation Spéciale, robbed a post office to raise funds for subversive activities and was arrested in 1950. He served two years of his seven-year sentence, escaping from Blida prison with his fellow activist Ali Mahsas. As the authorities sealed the city, the men evaded capture by spending the night with a dog in a kennel.
The Algerian independence movement had many strands, and its share of moderates seeking a negotiated settlement. But Ben Bella was not one. In hiding in Paris he discovered that his safe house was a few steps from that of Mahsas; the two men had been kept apart by the "liberals", the "centrists", the "bureaucrats" and the "electoralists" in the independence movement whom Ben Bella held in deep contempt. He left for Cairo and became one of the nine leaders of the "revolutionary committee" of the National Liberation Front (FLN). Backed by the Egyptian President Gamal Abdel Nasser, it launched a guerrilla war on 1 November 1954.
Ben Bella became France's most wanted man. He survived at least two attempts on his life – from a hitman and a parcel bomb – before being captured with other FLN leaders when the French army diverted their plane to Paris on 22 October 1956. He was released at independence in 1962 and was elected president in an uncontested election in 1963.
Fascinated by Tito's Yugoslavia, he launched an ambitious but economically disastrous land-reform programme based on peasant self-management. In an attempt to Arabise the education system he turned to Egypt and Syria for manpower. They sent teachers from the Muslim Brotherhood – one of the explanations sometimes given for the Islamic radicalisation of Algeria years later.
Throughout his presidency Ben Bella remained radically anti-imperialist, even flying to Cuba from New York after a United Nations General Assembly meeting, in deliberate breach of the US embargo. He was a leading supporter of the Non-Aligned Movement and established Algeria as a base for the world's liberation fighters: Nelson Mandela went through Algerian guerrilla training; Che Guevara spent several months there in 1963; Corsicans, Basques, Uruguayans, Chileans and the Namibian South West Africa People's Organisation (Swapo) were all invited to learn combat and resistance techniques from hardened Algerian maquisards.
Ben Bella also promoted the development of his own personality cult and alienated many former comrades. On 19 June 1965 he was deposed by an army strongman, Houari Boumédiène, assisted by Abdelaziz Bouteflika, the current president of Algeria. He was never tried, but was held under house arrest in a former French prison south of Algiers, and his name was excised from schoolbooks. In 1972, he married the radical journalist Zohra Sellami and she moved in with him. They adopted two daughters and the family lived a strange, semi-captive existence until 1980 when Ben Bella was released by President Chadli Benjedid and exiled to Lausanne, Switzerland.
A decade later he attempted a political comeback by chartering a ship from Barcelona and sailing into Algiers with supporters and the media. The Tunisian journalist Farida Ayari, who currently works for the Moroccan weekly Tel Quel, was aboard. "It was a complete flop," she said. "Ben Bella expected to sail into port and be greeted as the father and saviour of the nation but when we docked there was no one there. The authorities had succeeded in making him a non-person."
An Arab nationalist who saw the rise of radical Islam as a "misreading of the Koran", Ben Bella spent the last two decades of his life travelling between Switzerland and Algeria, campaigning on issues that spoke to his anti-imperialist fibre – against the "globalisation of poverty" and against the war in Iraq. In a 2006 interview with the Investig'Action website he said: "I am not a Marxist but I am resolutely of the left. I am an Arab Muslim. I have always supported movements of the left and socialist countries such as Cuba, China, the Soviet Union who drove the anti-colonialist and anti-imperialist battle."
But he also mellowed, to the extent that he no longer represented a threat to the government. His one-timejailer, President Bouteflika, perhaps also understood the historical need to rehabilitate Ben Bella. In his last years the former president was treated as such, invited to state functions and given a generous pension and a residence in Algiers.
Ahmed Ben Bella, activist and politician: born Maghnia, Algeria 25 June 1916; first president of Algeria 1963-65: married Zohra Sellami (died 2010; two adopted daughters); died Algiers 11 April 2012.