Tunisia’s ruling Islamists and opposition parties agreed late on Saturday to name the country’s current industry minister as prime minister of a caretaker technocrat Cabinet to govern until elections next year.

The appointment is the first step in an agreement that will see moderate Islamist party Ennahda hand over power in the next few weeks to end a crisis that threatened Tunisia’s transition to democracy after its 2011 uprising.

Three years after its protests against autocrat Zine el-Abidine Ben Ali inspired Arab uprisings elsewhere, Tunisia has been struggling to overcome disputes over the role of Islam in one of the Arab world’s most secular countries.

After weeks of wrangling, parties agreed to name Mehdi Jomaa, an aerospace engineer by training, as premier in a deal between Islamist party Ennahda and a coalition of secular parties led by a former Ben Ali official.

“Despite the difficulties, we have managed to reach an agreement over the name of Mehdi Jomaa,” Hussein Abassi, head of the UGTT union movement that brokered the talks, told reporters.

“The next government should be independent and nonpartisan to led the country to elections.”

Ennahda won the most seats in a national assembly selected in the first elections after the fall of Ben Ali, but the country struggled with a widening gap between Islamists and secular leaders.

Months of protests erupted after the assassination of two opposition leaders this year by Islamist militant gunmen, and secular opposition parties formed a broad coalition demanding Ennahda’s resignation.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.