Several foreign leaders attend state funeral as thousands gather in the streets of the capital, Tunis.

Thousands of people have gathered in the streets of Tunisia‘s capital, Tunis, to bid farewell to their first democratically elected president, Beji Caid Essebsi, at a state funeral that will be attended by foreign leaders.

Essebsi, who helped guide the North African country’s transition to democracy after the 2011 revolution, died aged 92 on Thursday.

The state funeral was expected to start at 11am (10:00 GMT) on Saturday and be attended by international dignitaries, including Algeria‘s interim President Abdelkader Bensalah, Qatar‘s Emir Sheikh Tamim bin Hamad Al Thani, French President Emmanuel Macron and Palestinian President Mahmoud Abbas.

Many roads were closed and security forces deployed in most areas of the capital and near the Al Jallaz cemetery.

Following Essebsi’s death, Prime Minister Youssef Chahed declared a seven-day mourning period and ordered flags at state institutions to be lowered to half-mast.

190725142610694

Meanwhile, parliament Speaker Mohamed Ennaceur was sworn in as interim president in line with the constitution, while the electoral commission announced a presidential election for September 15, two months earlier than scheduled.

A parliamentary vote is set for October 6.

A woman reacts during the funeral of the Tunisian President Beji Caid Essebsi in Tunis [Ammar Awad/Reuters]

Reporting from Tunis, Al Jazeera’s David Chater said: “Everyone will be talking about the way the constitution has already managed to ensure a stable transfer of power.

“Within hours of Essebsi’s death, the parliament speaker sworn in as interim president. That is his legacy.”

Tarik Kahlawi, political analyst, said that while the country faced major challenges including economic problems and security theats, Tunisians were proud of their country and former president.

“Many Tunisians are worried about the economic situation but this is also a proud moment. Tunisians are proud to be living in a democracy, that has a smooth political transition and fair elections,” Kahlawi told Al Jazeera.

Essebsi rose to prominence after the overthrow of veteran autocrat Zine El Abidine Ben Ali, which was followed by “Arab Spring” revolts against authoritarian leaders across the Middle East and North Africa, including in Libya and Egypt.

He was seen as a unifying figure but was ultimately unable to bring prosperity or lasting calm to a country beset by economic crises and fending off sporadic deadly attacks.

Thousands of people gathered in Tunis to bid farewell to Essebsi [Ammar Awad/Reuters]

Drafted in as prime minister after Ben Ali’s fall, Essebsi in 2012 founded the secular Nidaa Tounes party, now part of the governing coalition. Two years later, Essebsi became Tunisia’s first freely elected head of state.

As prime minister, he helped draft a new democratic constitution guaranteeing fundamental rights such as freedom of speech and preparing Tunisia for free elections.

He also co-brokered an historic power-sharing deal between his Nidaa Tounes movement and Islamist party Ennahda that helped to steady the country, as other parts of the region such as Syria, Yemen or Libya struggled with upheaval and violence.

Essebsi had recently announced he would not run in the election scheduled for November, saying a younger person should lead the country.