New York : President Beji Qaid Al Sebsi, Tunisia’s first popularly elected head of state, who steered the country through a democratic transition after an uprising that set in motion the Arab Spring of 2011, died Thursday morning in a military hospital in Tunis, the government announced in a statement. He was 92.

In a political career of more than 60 years, Al Sebsi was the only senior politician in Tunisia to hold political office under the rule of Habib Bourguiba, who became president after the country gained independence from France, and Zine Al Abidine Bin Ali, who was ultimately ousted, as well as in the new democracy.

Al Sebsi came out of retirement in 2011 to be interim prime minister — until the election of a constituent assembly — after the uprising that ended the 23-year rule of Bin Ali. The revolt in Tunisia sparked a series of antigovernment protests and rebellions across North Africa and the Middle East that became known collectively as the Arab Spring.

In 2014, Al Sebsi became the first Tunisian president elected in a free and fair election. He was in office at his death. This year, he had announced that he would not stand in elections expected in November, saying someone younger should take charge.

Born in 1926 in Sidi Bou Saïd, a cliff-top village north of Tunis, Al Sebsi trained as a lawyer in Paris.

He became a close ally of Bourguiba, defending him and other detainees during Tunisia’s struggle for independence from France in the 1950s. When Bourguiba became Tunisia’s first president after independence was obtained in 1956, Al Sebsi served as his director of security, interior minister, minister of defence and then foreign minister.

Throughout his life, Al Sebsi remained devoted to Bourguiba, seeing him as a hero and a guide. He wrote a book about him, “Habib Bourguiba: The Wheat and the Chaff,” that was published in 2009.

Under Bourguiba’s successor, Bin Ali, Al Sebsi was briefly head of Parliament, but he retired from politics in 1994, before Bin Ali’s corrupt and increasingly authoritarian government committed its worst excesses, developing a cult of personality and arresting and torturing political dissidents.

When Bin Ali was overthrown in January 2011 and fled to Saudi Arabia with his family, Al Sebsi was named interim prime minister, chosen because of his government experience and his relatively untainted reputation.

As a caretaker leader, he showed an even-handedness in steering the country through its transition to democracy, running fair elections for the constituent assembly and freely handing over power afterward to a government led by the formerly outlawed Islamist party Al Nahda.

Al Sebsi then helped found a secular political party, Nidaa Tounes, or Call for Tunisia. After two political assassinations in 2013 prompted protests, he led a movement to oust the increasingly unpopular Islamist government.

Tunisia managed a negotiated if fractious transfer of power, largely thanks to Al Sebsi.

At the height of the tensions, in 2013, as the country teetered on the edge of civil strife, Al Sebsi broke the political impasse by holding a series of private meetings with Rashid Gannouchi, the leader of Al Nahda, who had returned from years in exile during Bin Ali’s rule. Al Sebsi and Gannouchi had continued to meet regularly since then.

Bejbouj, as his supporters affectionately called him, won the trust of many Tunisians with his call for a strong state and a modern secular society — a prospect that stood in stark contrast to Al Nahda’s chaotic rule from 2012 to 2014. He also supported legislation to promote women’s rights, following Bourguiba’s lead.

His party won the most seats in the October 2014 parliamentary election, calling on the electorate to vote tactically against the Islamists. But he then formed a unity government, giving Al Nahda one cabinet post.

Al Sebsi is survived by his wife, Chadlia Saïda Qaid Al Sebsi, and four children, among them the politician Hafedh Qaid Al Sebsi, who assumed leadership of his party.

Tunisian society remains deeply fractured. Politically, secularists, including vocal leftists and Arab nationalists, contend with Islamists, who won about 28 per cent of the vote in the 2014 legislative elections. Socially, a rich elite living in the coastal cities is divided from the poor, underdeveloped inland regions, where the revolution began and where popular unrest continues.

Al Sebsi has called for reconciliation by emphasising patriotism above party politics. Among the projects he left unfinished were plans for a sculpture of Hannibal in Carthage.

In one of his last speeches, on April 6, during the Nidaa Tounes party congress, Al Sebsi spoke for about 40 minutes without notes, directing jibes at Al Nahda and making the crowd laugh.