Tunisia laid to rest its first democratically elected president Beji Caid Essebsi on Saturday at a state funeral. The occasion was marked by the attendance of several world leaders, including French President Emmanuel Macron. The UAE was represented by the Ruler of Fujairah, Sheikh Hamad bin Mohammed Al Sharqi, state news agency Wam reported. Other dignitaries attending the funeral in the capital Tunis included Algerian President Abdelkader Ben Saleh, Palestinian President Mahmoud Abbas, and King Felipe VI of Spain, along with thousands of Tunisians. Caid Essebsi won Tunisia's first free election after the 2011 uprising that toppled autocratic ruler Zine El Abidine Ben Ali. Tunisia remains plagued by economic troubles and sporadic terrorist attacks but is the only country to emerge from the Arab uprisings with a functioning democracy and is relatively open and stable compared to other countries in the region. Many roads were closed and security forces deployed in most areas of Tunis and near the Al Jallaz cemetery. Tunisians lined the streets leading to the Carthage district, waving flags and chanting the national anthem. Officers in full uniform carried the coffin draped in the Tunisian flag into a ceremonial room at the Carthage palace packed with dignitaries, placing it on a dais. Parliament speaker Mohamed Ennaceur, who was sworn in as interim president hours after Caid Essebsi's death, paid tribute to the late leader describing him as "the architect of national reconciliation". "He was determined to successfully achieve democratic transition" in the birthplace of the Arab uprisings, Mr Ennaceur said. The parliament chief took over as per the provisions of the constitution, which also requires a presidential election to be held within 90 days of the incumbents's death. The presidential election scheduled for November has been brought forward and is tentatively scheduled for September 15, according to election officials. A parliamentary vote is set for October 6. Mr Macron hailed a leader who "in these times of threatening obscurantism... was keen on keeping Tunisia enlightened, tolerant and committed to universal values." Drafted in as premier after Ben Ali's fall, Caid Essebsi in 2012 founded the secular Nidaa Tounes party, now part of the governing coalition, to counter-balance the resurgence of Islamists who were suppressed under the former leader. Two years later, he became Tunisia's first freely elected head of state. Caid Essebsi is the first president to receive a state funeral since Tunisia gained independence from France in 1956 and the government has declared seven days of mourning. The country's first president Habib Bourguiba was buried in a hasty ceremony in 2000. Caid Essebsi's death comes amid a power struggle between Prime Minister Youssef Chahed and the president's son, Hafedh Caid Essebsi, that has led to the premier being sidelined from Nidaa Tounes and forming a rival party, Tahia Tounes. It also comes amid a debate over who will be able to stand in the presidential election since Caid Essebsi died without either rejecting or endorsing an amended electoral code that set the conditions for eligibility of candidates.