An alliance of Tunisian workers, employers, lawyers and activists won the Nobel Peace Prize on Friday, a decision meant to honor the quest for democracy in the nation that gave birth to the Arab Spring as well as urge it on at a time when its still-tenuous gains are increasingly under threat.

The quartet of groups, including a labor union with about 1 million members, has worked to advance democracy in Tunisia, which still struggles with unrest but has made relative strides toward reforms even as other Arab Spring nations face greater violence, instability and the reemergence of dictatorships.

During critical junctures in 2013 and 2014, the civil society groups provided a vital bridge for dialogue and political compromises between the Islamists then in government and Tunisia’s opposition and secular movements. The opened channels helped ease the deep polarization and mistrust that have torn apart other nations in the aftermath of the Arab Spring upheavals.

More broadly, the award was aimed at supporting the nation where the Arab uprisings began after street vendor Mohammed Bouazizi immolated himself Dec. 17, 2010, to protest official repression and corruption. The fragility of the progress made in Tunisia was highlighted as recently as Thursday, following the attempted assassination of a leading secular politician. The largest source of foreign fighters joining the Islamic State, Tunisia is also in the midst of a crackdown on extremists that critics fear could fail to quell mounting violence or overreach and undermine hard-won civil rights.

“More than anything, the prize is intended as encouragement for the Tunisian people who have laid the groundwork for a national fraternity which the committee hopes will be followed by other countries,” the Nobel committee said.

The National Dialogue Quartet — including the Tunisian General Labor Union (Houcine Abbassi, secretary general), the Tunisian Confederation of Industry, Trade and Handicrafts (Wided Bouchamaoui, president), the Tunisian Human Rights League (Abdessattar ben Moussa, president) and the Tunisian Order of Lawyers (Fadhel Mahfoudh, president) — has made a “decisive contribution to the building of a pluralistic democracy in Tunisia in the wake of the Jasmine Revolution of 2011,” the committee said.

Tunisian President Beji Caid Essebsi hailed the award as a sign of hope at a time when Tunisians needed it most. “I know the situation is currently very difficult in Tunisia,” he said in a video posted on Facebook. “And despite all the rumors circulating about yesterday’s incident [the attempted assassination], we have received happy news. Not everything is dark and grim.”

Following the fall of President Zine el-Abidine Ben Ali in 2011, Tunisia’s democracy has emerged as the strongest in the Arab world, even as it confronts still-deep divisions and challenges. After a dialogue between Islamist and secular lawmakers, Tunisia last year passed a constitution seen as one of the region’s most liberal, winning praise from human rights groups. Last year, Tunisia also held its first democratic presidential elections, voting in Caid Essebsi, who served under the repressive regime of former president Habib Bourguiba.

“I am astonished,” a breathless Ali Zeddini, vice president of the Tunisian Human Rights League, told The Washington Post. “I am so happy. There are calls coming in from all over the world. I can barely believe this is happening,”

But he acknowledged that the decision comes “at a time of great stress and tension in Tunisia.”

“It has reminded us of our accomplishments and places great responsibility on us to maintain peace and our democracy through dialogue,” he said.

Tunisia has been spared the widespread bloodshed that has plagued the rest of the Arab world since uprisings swept the region four years ago. But the political openness that followed the revolt also allowed extremists to organize and challenge secular traditions in a nation highly influenced by European culture even after winning independence from France in 1956.

After parliamentary elections in 2011, a moderate Islamist party, Ennahda, came out on top. But attacks by extremist Islamists on liberal politicians and other targets polarized Tunisian society. While extremists were denounced by the governing Islamists, many feared the tiny North African nation was on the verge of collapse.

Enter “the quartet.” During Tunisia’s months of severe institutional crisis in 2013, and amid a storm of political, economic and security problems, the alliance made a vital difference. Inflation was rising. Terrorist attacks were rising. And the political brawls between Islamists and secularists worsened amid the assassinations of two prominent opposition leaders: Mohamed Brahmi and Chokri Belaid.

The civil society groups intervened at the height of the crisis in 2013 and provided critical channels for dialogue and political compromises. The heavyweight in the quartet was the UGTT: the Tunisian General Labor Union, which wielded enormous power to call general strikes and enjoyed broad credibility in Tunisian society. Its leader, Houcine Abbassi, emerged as a key negotiator in the resulting compromise that kept the peace. After tough negotiations, the Islamists surrendered power to a transitional government and agreed to a time frame for new elections and plans for a draft constitution.

“This came down to the basics of negotiation,” said Sarah Chayes, a senior associate at the Carnegie Endowment for International Peace. “It was a case of, ‘You shut up and let the other person speak.’ This is about how you make people speak with each other who don’t particularly want to.”

Critics, however, suggested that the Nobel committee had failed to fully acknowledge the extent of the political violence still gripping Tunisia.

But the prize was widely hailed as a nod toward the ability of Tunisia’s political and civil groups to seek dialogue while other Arab Spring neighbors have stumbled back to bloody power struggles or tighter rule.

The nation has indeed struggled to find a lasting peace, and fears have reemerged about the threat to democracy following a crackdown against rising Islamist extremism. After a Tunisian gunman thought to have received training from Islamists in Libya killed 38 people at the beach resort of Sousse last June, the government vowed to shut down extremist mosques and take other steps to curb terrorism. In March, extremists staged a dramatic attack at a museum in downtown Tunis, killing 21 people.

“This decision hit me like a rock,” said the Berlin-based Tunisian political scientist Hamdadi el-Aouni. “I do not know what these people of the committee were thinking. I’ve just come back from Tunisia. There is no state, just total chaos. And there is certainly no peace there.”

In a congratulatory Twitter post, the Ennahda party hailed the award as “a victory for all Tunisians, who showed strength, patience & commitment to peace & democracy in the face of countless challenges.”

A message on the Facebook page of the General Labor Union celebrated: “Alf mabrooooouk kul al Tuniseeeeeeen.” (A thousand congratulations to all Tunisians.)

Read more:

Why the Nobel peace prize was awarded to the Tunisian National Dialogue Quartet, in one map

In birthplace of Arab Spring, Tunisia’s Islamists get sobering lesson in governing

Tunisia’s president sets out goals

Tourist in museum massacre: “Hoping just to survive”

Erin Cunningham in Beirut, Heba Habib in Cairo, Stephanie Kirchner in Berlin and Brian Murphy, Kevin Sullivan and Mary Beth Sheridan in Washington contributed to this report.