Egypt's Islamist-run assembly has backed a draft constitution, including a measure keeping sharia, or Islamic law, as the main source of legislation.
The draft will now be sent to President Mohammed Morsi, who is expected to call a referendum on the issue.
The move comes after the constitutional court said it would rule on Sunday whether to dissolve the assembly.
Egypt's judiciary is in a stand-off with the president after he granted himself sweeping new powers.
Mr Morsi says his decree should only apply for as short a time as possible.
Liberal, left-wing and Christian members of the constitutional assembly boycotted the vote, accusing the Islamists of trying to impose their vision.
The assembly backed all the 234 articles of the draft after a marathon session that began on Thursday and continued through the night.
According to Egyptian state TV, the articles passed stipulate the Islam is the religion of the state, and the principles of sharia are the "main source of legislation".
This is unchanged from the previous constitution under Hosni Mubarak, who was toppled as president last year.
Salafists and some members of Mr Morsi's Muslim Brotherhood failed to have "principles" replaced by "rules".
The draft also says that Christianity and Judaism will be the "main source of legislation" for Egyptian Christians and Jews, state TV reported.
The assembly also adopted a new article that al-Azhar mosque and university, authorities on Sunni Muslim jurisprudence, must be consulted on "matters related to sharia".
The president will be limited to two four-year terms of office.
The opponents of the draft voiced concern that some clauses - such as the importance of promoting families values - could be used to restrict freedom of speech.
They also said that there was no specific article establishing equality between men and women.
Opposition figure and former Arab League chief Amr Moussa told Reuters news agency: "This is nonsensical and one of the steps that shouldn't be taken, given the background of anger and resentment to the current constitutional assembly."
The BBC's Jon Leyne, in Cairo, says issuing a constitution in these circumstances would be a deeply inflammatory move.