The careful balancing led to some contradictions in the text, occasionally even within a single article, said Amira Yahyaoui, founder of Al Bawsala, a nonprofit that monitors the constituent assembly. “There are some very, very good articles and some bad,” she said.

Ms. Yahyaoui noted that the Constitution guaranteed freedom of religion, conscience and expression, but that it also said it was the state’s duty to “protect the sacred,” a phrase that reflects Islamists’ desire to prevent abuse of Islam. The two passages, she said, are incompatible.

But Mr. Fehri, the secular politician, said the balance was necessary. “Our opinion is different, so you have two explanations for the same thing,” he said, referring to an assembly member who is also an imam, who praised the first article from an Islamic point of view. “So when it comes to interpretation, they will take both into account.”

Human rights organization praised the Constitution, in particular for its recognition of universal human rights standards and conventions. “We are a far cry from how it was in the beginning,” said Amna Guellali, a Tunisian lawyer and researcher for Human Rights Watch. Tunisia’s laws do still discriminate against women on issues such as inheritance and child custody, and Ms. Guellali said it would be up to future governments to decide how the new Constitution changes that.

There were moments during the voting in the semicircular assembly chamber that reflected the struggles faced in 30 years of opposition to the succession of dictators that formerly ruled Tunisia. For some, those struggles included discrimination, imprisonment and exile.

When Article 45 was passed, guaranteeing women’s rights and parity for women in elected bodies — a first in the Arab world — the chamber rose as one and sang the national anthem.

For Amer Laarayedh, head of Ennahda’s political bureau and brother of former Prime Minister Ali Laarayedh, the most emotional moment was the passing of Article 20, which recognizes the rights of refugees.