TUNIS, Tunisia (AP) — Tunisia’s ruling Islamists have agreed to an initiative by the country’s main labor union to avert the brewing political crisis by eventually forming a government of technocrats, a top union official said Thursday.

The assassination of an opposition politician in late July plunged the country into crisis, with the opposition demanding the government and assembly elected in 2011, be dissolved — demands backed up by demonstrations and sit-ins.

There were even fears that Tunisia, the birthplace of the Arab Spring, might go the way of Egypt, where dissatisfaction with Islamist rule resulted in a military coup and the bloody suppression of the Muslim Brotherhood, killing more than 1,000 people.

Tunisia, however, has managed to avoid the persistent bloodshed and cycle of unrest that has roiled Egypt after the overthrow of its president just a month after Tunisia deposed theirs on Jan. 14, 2011. Despite a rocky transition, the Islamist-dominated government and the secular opposition parties have always been able to reach a compromise.

Mouldi Jendoubi, the assistant secretary general of the General Union of Tunisian Workers, known as the UGTT, told the state news agency that the moderate Islamist Ennahda Party had agreed to a government of technocrats “to get the country out of its current crisis.”

The announcement follows talks between Ennahda leader Rachid Ghannouchi and the powerful union head Houcine Abassi. The union, long a bastion of left-wing politics, has generally sided with the opposition against the government, but in the latest crisis took on a role as a mediator.

A subsequent statement by Ennahda said the party accepted the union’s initiative as a starting point for dialogue and the current government would remain until an agreement was reached.

“The coalition government will not resign and will continue its duties until national dialogue reaches a consensus agreement that guarantees the completion of the democratic transition and the organization of free and fair elections,” the statement said.

Opposition reaction to the announcement was mixed, with Nejib Chebbi, head of the liberal Jomhouri (Republican) party, welcoming it as a “positive step to relaunch the national dialogue as soon as possible and find an end to this crisis.”

Other parties, however, stuck by their initial demands for the dissolution of the assembly and the government before any talks.

“We are committed to dialogue, but only after the resignation of the government,” Ayda Klibi, spokeswoman for the right of center Nida Tunis (Tunisia Calls) party, told The Associated Press.

Opposition politician Mohammed Brahmi was shot 14 times in front of his family at his home July 25, the second politician killed in this manner in the past five months. His death provoked widespread condemnation of the government for not being able to maintain security in the country.

Dozens of opposition deputies have suspended their participation in the assembly charged with running the country and writing the new constitution and called for its dissolution — a demand Ennahda has repeatedly rejected.

Instead, the government has offered a roadmap to complete the constitution and hold new elections by the end of the year.

The government has said that Islamist militants linked to al-Qaida’s branch in North Africa are behind the assassinations, and has battled members of the group in mountain strongholds near the Algerian border.

With an educated, largely middle class population of 10 million, Tunisia has been singled out as the most likely to make the transition to democracy following the region-wide uprisings of the Arab Spring.

While its political scene has been deeply polarized between Islamist and secular parties, there have been several cases of compromise and cooperation since the revolution, distinguishing Tunisia from its neighbors.

The latest agreement follows an Aug. 15 meeting in Paris between Islamist leader Ghannouchi and opposition stalwart Beiji Caid Essebsi of Nida Tunis, widely seen as the most powerful opposition leader and vocal opponent of Ennahda.