Rachid Ghannouchi, leader of the Islamist party Ennahda, gives a speech outside Ennahda's headquarters in Tunis on October 27, 2014. (Zoubeir Souissi/Reuters)

On a recent warm evening, hundreds of men and women were mingling outside the offices of Tunisia’s Islamist party. They were singing and cheering. They were waving little red-and-white Tunisian flags. It looked as if they had just won an election.

In fact, they had just lost control of parliament. But in a strife-torn Arab world, this young democracy had pulled off a rare feat: a clean, peaceful election.

“What are we celebrating today?” the Islamists’ leader, Rachid Ghannouchi, a 73-year-old scholar, cried into a microphone as fireworks popped overhead. “We are celebrating freedom! We are celebrating Tunisia! We are celebrating democracy!”

Nearly three years after the Arab Spring, the hopes unleashed by the mass uprisings have largely given way to despair. Egypt suffered a coup; Libya is lurching toward civil war; Syria has experienced a bloodbath. Tunisia is the only country to overthrow a dictator and build a democracy. On Sunday, Tunisians will cast ballots in the second round of national elections, choosing a president after the Oct. 26 parliamentary vote.

Still, the Islamists’ defeat in the first round reflects the clear discontent with what democracy has yielded. Ghannouchi was symbolic of Islamists in the region who surged to power after the uprisings and hoped to transform countries ruled by secular autocrats. But Tunisia’s government has struggled to contain terrorism, revive the economy and win over a deeply secular society.

Map: The uprisings of 2011 have succeeded in bringing a functioning democracy to only one country, Tunisia.

And Tunisia’s political stability is hardly assured. The leading candidate in Sunday’s elections is Beji Caid Essebsi, 87, who served in authoritarian governments before the revolution. His staunchly secular party also won the parliamentary elections. Although Essebsi is seen by many as a moderate, Islamists are alarmed.

“I fear that if Essebsi wins the presidency, it’s game over,” said Radwan Masmoudi, a Tunisian American Muslim activist and longtime supporter of Ghannouchi, speaking in Tunis several days after the rally. “It’s basically the old regime controlling everything.”

Ennahda’s rise to power

Tunisia is overwhelmingly Muslim, but the country was forcibly secularized during five decades of autocratic government. Secret police harassed men who frequented the mosque; female students were forbidden to wear the head scarf — “that odious rag,” in the words of Habib Bourguiba, the ambitious modernizer who led the country to independence from France in 1956. Today, abortion is legal, female students outnumber men at universities, and bikini-clad sunbathers crowd the Mediterranean beaches.

Many Islamists despaired of ever coming to power. But Ghannouchi never gave up. A philosophy teacher who studied in Paris and Syria, he had founded the country’s main Islamist party in 1981. He fled into exile in 1989 after being sentenced to death, and thousands of party members were jailed. Masmoudi recalls how, in 2004 or 2005, the scholar told him that he believed there would one day be a revolution in Tunisia.

“I assure you, there is not going to be a revolution in Tunisia in the next 50 years — except if they increase the price of beer,” Masmoudi told him.

Over two decades, living quietly with his wife and six children in London, Ghannouchi kept his Ennahda party alive.

In 2011, Tunisian dictator Zine el-Abidine Ben Ali was toppled and Ghannouchi finally flew home. In the first post-revolution election, Ennahda won over 40 percent of seats in the Constituent Assembly, making it the biggest party.

A woman walks past a sign that reads "TUNISIA: First democracy in the Arab world.” (Mary Beth Sheridan/TWP)

“For him, this is the promised land,” said Masmoudi. “This is God’s promise. This is the relationship he had with God, and the faith. Now God has saved and delivered, and answered his prayers.”

‘Demolition of a myth’

In exile, Ghannouchi had become one of the world’s best-known Islamist thinkers. He believed faith should infuse politics, and, like many Islamists, was harshly critical of Israel and U.S. foreign policy. But he embraced democracy — free elections, a free press, women’s rights. On a theoretical level, “Ennahda is just about as moderate as you can possibly get while still being an Islamist party,” said Shadi Hamid, a fellow at the Brookings Institution and author of “Temptations of Power,” on Islamist movements.

But back in Tunisia, governing proved harder than Ghannouchi had ever imagined.

“The reality is more complicated than any sort of theory,” he said this month in an interview in his office, sitting under a swirling gold calligraphy sign proclaiming “Muhammad.”

On reaching government, Ennahda sought to calm the public’s suspicions of an Islamist party. It formed a coalition with two smaller secularist parties. It pledged not to impose the head scarf or limit women’s rights. In its first year in power, beer sales surged to historic levels.

But its first big challenge wasn’t the secularists. With freedom of speech, radical Islamists turned up in mosques, preaching violence and intolerance. The government was caught off-guard.

“We ourselves were victims of prison and jail. It’s not easy for us to send others to jail,” said Ghannouchi, who did not assume a government position but led his party.

On Sept. 14, 2012, hundreds of Islamists attacked the U.S. Embassy in Tunis, smashing windows and throwing gasoline bombs, after the release of a crude online video denigrating the prophet Muhammad.

Ghannouchi became furious. “He couldn’t understand how we let it happen,” said Lofti Zeitoun, a longtime aide. “He was on the phone to the president, the prime minister, the Ministry of the Interior, watching TV, asking them to intervene.”

The government eventually outlawed the group behind the attack — Ansar al-Sharia, an al-Qaeda-linked organization. But many Tunisians were disgusted with the government’s slow response to a series of terrorist attacks.

The party faced huge expectations but had few experienced administrators. Many Ennahda supporters “thought that God will be on the side of Ennahda in governing this country,” said Amine Ghali, program director of the al-Kawakibi Democracy Transition Center, which works on legal issues. “This is the demolition of a myth.”

Ennahda leaders struggled to placate moderates while satisfying a base that included ultraconservatives. Some Ennahda members pushed to make sharia, or Islamic law, the main source of legislation. The party proposed language in the new constitution that would describe men and women as “complementary” rather than equal. Secularists became alarmed.

In July­­ 2013, Tunisia’s democracy almost went off the rails. Islamist extremists pumped 11 bullets into Mohammed Brahmi, in the second assassination of a leftist politician in five months. Secular demonstrators poured into the streets. The powerful national labor union, the UGTT, declared a general strike.

Nearby in Egypt, the military had just overthrown the elected Islamist government. Tunisian demonstrators began to call for the same. “A coup d’etat can happen,” Ghannouchi remembers thinking.

But Tunisia had some advantages over Egypt. Its military is far weaker, its civil-society institutions are stronger. The labor union launched a “national dialogue” to bring the political parties together. After weeks of negotiations, a deal was reached. Tunisia’s politicians would approve one of the Arab world’s most liberal constitutions. And Tunisia’s first Islamist-led government would step down early, replaced by technocrats until the 2014 elections.

Many members of Ennahda’s governing council initially opposed the deal. “It was very hard to convince them,” Ghannouchi said. But he warned that if they didn’t go along, “the Tunisian experience of transition will be collapsed.”
Hope for political recovery

These days, festive strings of tiny Tunisian flags flutter over Avenue Habib Bourguiba, the central avenue in Tunis, marking the elections. But in the packed cafes along the tree-lined boulevard, it is easy to find signs of disillusionment with Ennahda.

“We voted for Ennahda mainly to have social justice and equality,” said Labidi Jaouher, 27, a mechanical engineer, who sat sipping espresso with two iPhone-tapping colleagues.

“They did not tackle the economic issues. That was one of their big mistakes,” said his friend, Hamdi Abdessalem, 24.

Indeed, while debates over the role of Islam have dominated the nation’s politics, polls showed Tunisians are far more concerned about the country’s 15 percent unemployment rate, which soars much higher among university graduates.

Tunisia’s Islamists have spent the past few weeks in meetings, licking their wounds and worrying about their future. Ennahda decided months ago not to field a presidential candidate, concerned that it would sweep both rounds of elections and unnerve its opponents. Now it may be shut out of government entirely.

Still, the party won 69 seats in the 217-member parliament, the second-biggest bloc behind the winner, Nida Tunis, which got 85. Even critics note that the Islamists will be a significant political force.

Ennahda made some mistakes, Ghannouchi acknowledged. But as long as democracy survives, he said, the Islamist party can recover.

“If you compare what happened in our neighbors,” he said, “we are living the best situation in the Arab world.”