Whereas many observers are lamenting the failure of the “Arab Spring,” Tunisia has proven once again that it is on a march toward democracy. On January 3, the National Constituent Assembly (NCA) began voting on the country’s new constitution. Lawmakers have approved many of the chapters and articles, and the final vote on the entire document should take place within a few days. Surprisingly, many of the controversial articles on state identity, the relationship between religion and politics, and gender equality have passed with a clear majority. The next step is to set dates for the parliamentary and presidential elections before the end of the year.

Nevertheless, Tunisia’s path to such success was not easy or smooth. According to the original roadmap that was crafted after the downfall of President Zine el-Abidine Ben Ali in January 2011, the NCA that was elected in October 2011 was supposed to finish the new charter within a year. The political disagreements between the ruling Islamist party, Ennahda, and the secular opposition, coupled with social unrest stemming from the assassinations of two political opposition figures by Salafis, disrupted the process many times.

Tunisia’s new charter underscores the country’s civil character and creates a more balanced political system. While it upholds Islam as the religion of the state, as has been the case in Tunisia’s constitution since it was first adopted in 1959, the new charter stipulates that the country is a “civil state based on citizenship, people’s will and rule of law.” Surprisingly, the draft constitution abandoned Islamic law (Shariah), which can serve as a precedent in the Sunni Arab world. However, the most significant development in Tunisia’s new charter is the protection of freedoms and human rights. It guarantees personal and public freedoms, such as freedom of conscience, which protects those of all beliefs; freedom of expression; freedom of assembly; and the right to strike—though it also criminalizes violent incitement and apostasy.

Another striking element of the new constitution is its commitment to gender equality. It emphasizes the equality between men and women and forbids sex discrimination. Article 20 stipulates, “All male and female citizens have the same rights and duties. They are equal before the law without discrimination.” This article was a subject of intense debate between Ennahda and women’s groups and activists before it passed by a vote of 116 to 40, with 32 abstentions.

Discussions regarding article 12, or the right of the country’s poor and underdeveloped areas to receive economic assistance from the government, were also heated. While some lawmakers rejected this article, other members, particularly those who represent the southern and western provinces, threatened to boycott the vote if the article did not pass. It was approved by 144 votes against 33 objections and 7 abstentions.

Furthermore, unlike its Egyptian counterpart, Tunisia’s charter neutralizes the political role of the military and the police. It explicitly states that “the military defends the country, [and] must remain neutral and support the civilian authorities.” The charter also neutralizes the partisan and political role of mosques and places of worship by prohibiting political activities inside mosques.

Yet Tunisia’s new charter is not perfect. It is being criticized for maintaining the death penalty, and some human rights organizations have called for more specific language on women’s rights and upholding international human rights conventions and standards. But overall these organizations are praising the progress they see in the constitution.

Three key factors have paved the way for the successful drafting of Tunisia’s constitution. First is the fact that Tunisian lawmakers have negotiated, compromised, and given concessions. Despite the political disputes and profound ideological divisions that marred the country’s politics after the fall of the former regime, political players realized that giving concessions is the only way to move forward and to avoid the fate of other Arab Spring countries such as Libya, Egypt, and Syria. This tendency was institutionalized within the NCA through the creation of a “consensus committee,” which was tasked with ironing out differences among members regarding the constitution. The committee played a crucial role in amending members’ proposals and hammering out deals among factions. The NCA made the amendments proposed by the consensus committee binding before the vote on the constitution.

Second is the robust role of civil society, particularly women’s groups. Many NGOs, such as the Tunisian General Labor Union (UGTT) and the Tunisian Union for Industry, Commerce, and Handicrafts (UTICA), joined with women activists to press for a progressive and representative charter. Through constant demonstrations and protests, they pushed political forces, particularly Ennahda, to give many ideological concessions. For instance, women’s groups lobbied for enshrining gender equality in the new constitution. When Ennahda proposed a vague article that did not emphasize full equality between men and women, these groups rallied against the proposal until Ennahda accepted a new article clearly guaranteeing women’s rights.

Third is the flexibility and willingness of Ennahda to compromise and reach an agreement with other political forces. Ennahda sought to avoid the blame of a failed constitution. Unlike their counterparts in Egypt, Ennahda lawmakers were keen to discuss controversial constitutional issues with their opponents, such as the relationship between the state and religion, the role of Shariah law, and women’s rights. Ennahda seems to have learned from the Muslim Brotherhood’s defeat in Egypt, and chose to compromise instead of lose everything. This choice was clear when the party, in the midst of the political deadlock that paralyzed the country in the summer of 2013, agreed to relinquish power to a nonpartisan and technocratic government in order to defuse tensions and bridge the gap with the opposition.

Nonetheless, the progress in regard to Tunisia’s first constitution after the 2011 uprising should not blind us from considering other challenges that are facing the country. These range from the fragile economy, in particular high unemployment, to security threats and confrontations with militant Islamists. Yet, if ratified and embraced by the NCA, Tunisia’s new charter will be a major step forward in the path toward democracy, giving hope that the calls of the Arab Spring protestors can be realized.