Tunisia's Prime Minister Hamadi Jebali, who quit on Tuesday after failing in his efforts to form a government of technocrats, emerged from jail under an autocratic regime as a man of compromise.
The assassination on February 6 of secular opposition figure Chokri Belaid pushed Jebali, the Ennahda party's number two, into a showdown with party hardliners who rally around their chief, Rached Ghannouchi.
The pragmatic 63-year-old premier sprung a surprise by calling for a government of technocrats to be formed as a way out of the political turmoil after violent protests erupted after Belaid's murder.
"Jebali now knows the reality of what it means to be in power; he has exceeded his fears and begun to act like a statesman," one European observer said at the time.
With his neatly trimmed white beard, thin-framed glasses and the prayer mark of a pious Muslim on his forehead, Jebali has been a main player in Tunisian politics.
He has staked his future on his call for a non-partisan government, winning the support of much of the political class and powerful secular trade unions.
Despite Ennahda's fury, Jebali threatened to quit on February 16 unless key ministries currently held by Islamists go to independents in his proposed new government.
He pressed on with his efforts to form a non-partisan government, saying the move had to be taken in the national interest, to prevent the country from sliding into "chaos."
Jebali threw in the towel on Tuesday, however, saying: "I promised and assured that, in the event that my initiative failed, I would resign as head of the government, and that is what I have done."
A native of the eastern town of Sousse, Jebali is a solar engineer and former journalist who co-founded in 1981 the Islamic Tendency Movement that became Ennahda (Renaissance in Arabic) eight years later.
Sentenced to death in 1987, just before the removal of then president Habib Bourguiba, the founding father of independent Tunisia, he fled to Spain.
In 1989, he returned following the declaration of a general amnesty, and established Ennahda's newspaper, El Fajr.
Two years later he was sentenced to a year in prison for defamation.
In 1992, as the anti-Islamist repression under Zine El Abidine Ben Ali gathered steam, he was sentenced to another 16 years behind bars.
He served a large part of his sentence in an isolation cell before being pardoned in 2006.
Relaxed and quick to smile, well-dressed and a fluent French speaker, Jebali "has always had good press, is well connected, and has a fat contact book," notes Sofiene Ben Fahrat, an analyst and writer.
Jebali was a model of reassuring Islam, despite stumbling on occasion, including once when he alarmed some observers with a reference to the "caliphate," an old system of government based on Islamic sharia law.
He also enjoyed support from abroad, from the Gulf to the United States and Europe, where he used to mobilise political support and funding for the country riven by social and economic troubles.
After the uprising ousted Ben Ali in January 2011, Jebali had travelled to Washington with two other "modernist" party members, holding high-level talks with US representatives in a bid to calm fears.
"He is well known to the Americans," one diplomat in Tunis said at the time. "He is very calm, self-assured, and expresses himself in a measured fashion. But he is not soft; his years in prison forged a character of steel."