The law mandates jail sentences of up to one year and fines as punishment for anyone found guilty of inciting, participating or organising such a protest.
Speaker of parliament Fathi Surour said the law was passed by a majority of the ruling National Democratic Party-dominated parliament. He said 59 lawmakers had submitted a bill protesting the draft, citing it was a violation of the constitution in that it "restrains liberties and the freedom of expression".
Members of parliament from the Muslim Brotherhood, the country's most powerful opposition group and which controls a fifth of the seats in parliament, opposed the law.
The government has touted the law as a bid to protect the sanctity of places of worship.
In practice such places, especially mosques, are among the only venues protestors can assemble without incurring swift, sometimes violent police intervention, as protests are illegal without government approval. Such approval is granted only on very rare occasions and usually only to government-backed or -sponsored demonstrations.
In recent years, the Brotherhood and other opposition groups have held numerous protests in mosques, including the historic Imam Hussein mosque and al-Azhar mosque, often held after weekly Friday prayers.
Members of Egypt's Coptic Christian minority have also held protests in some churches or in Cairo's main Coptic cathedral.
Prior to the vote, the Minister of Religious Endowments Mahmoud Hamdi Zakzouk said some people were using mosques for protest after Friday prayers every week and inviting satellite television news team to the protests "to promote political ideas that have no connection to religion."
A member of the Brotherhood's parliamentary bloc, Mohamed el-Beltagui said the law was part of a raft of laws "to jail political opponents, gag mouths and constrain liberties."
There are about 100,000 mosques in Egypt and about 2,500 churches.
Last Mod: 03 Nisan 2008, 14:34