Tunisia's Islamist-dominated constituent assembly compromised in rejecting Islam as the main source of law as it voted on a new constitution for the country that spawned the Arab Spring.
But while it established Islam as the state religion, it promised freedom of conscience, despite one MP warning that "Satanists" and "idolaters" would be practicing in public and criticism by a rights group it was too vague.
Saturday's sitting of the National Constituent Assembly, which has adopted 12 out of 146 articles, came amid concerns a January 14 deadline for the charter's approval could be overshot because of disruptions and the slow pace of deliberations.
The first two articles adopted, neither of which may be amended, establish Tunisia as a "civil" republic based on the rule of law and with Islam as its religion.
The assembly rejected amendments proposing Islam and the Koran and Sunna - the sayings and acts of the Muslim Prophet Mohammed - as "the principal source of legislation".
In what was a raucous session that had to be suspended at one point, Mohamed Hamdi of the small Current of Love party defended Islamic law, saying it would give "spiritual backing to all rights and liberties".
But Mahmoud Baroudi, of the secular Democratic Alliance, said the proposed amendments were "against modernity".
Another key precept adopted, Article Six, makes the state the "guardian of religion, protector of the sacred" and guarantor of "freedom of conscience".
It would also place mosques and other places of worship out of bounds to political activity.
Azed Badi, of the Wafa party, objected, saying the article would "allow Satanists and idolaters to organise public events to spread their beliefs".
But Ennahda's Sonia Ben Toumia countered by saying "Islam is a religion that guarantees freedom of religious practice to others". And secularist Iyed Dahmani said "those opposed to freedom of conscience want to take us back to dark periods in history when tribunals examined the beliefs of people".
Yet the Tunisian League of Human Rights was uncomfortable with Article Six.
It argued that defining the state as protector of religion was vague and open to interpretation, and could threaten freedoms.
Approving the new constitution would end months of political crisis and further distance Tunisia from the chronic instability plaguing other countries in a region rocked by regime change.
Ousted dictator Zine el-Abidine Ben Ali and his family fled the country for exile in Saudi Arabia on January 14, 2011.