Parliament has voted to amend the constitution to lift a decades-old ban on Islamic head scarves at Turkey's universities, despite fierce opposition from the secular establishment.

Tens of thousands of Turks demonstrated in the capital, Ankara, against the amendments and called for the government's resignation. "Turkey is secular and will remain secular," they chanted, many waving flags.

In a final vote, lawmakers voted 411-103 on Saturday to approve two constitutional amendments that will add paragraphs saying everyone has the right to equal treatment from state institutions and "no one can be deprived of (his or her) right to higher education."

The changes must be signed by President Abdullah Gul, an observant Muslim who is widely expected to approve the amendments.

One lawmaker said lifting the ban amounted to "the death of the secular republic."

The constitutional changes "will create chaos in universities and will lead to the disintegration of the nation," said Kamer Genc, an independent.

Head scarves have long been prohibited at universities in predominantly Muslim but fiercely secular Turkey, a country seeking to join the European Union.

But Prime Minister Recep Tayyip Erdogan called the ban a trial for young Muslim women who are forced to remove their traditional head scarves at campus entrances. Some resort to wearing wigs to class to cover their heads.

"We will end the suffering of our girls at university gates," Erdogan, whose Justice and Development Party has ties to Islam, had said Thursday.

The main opposition Republican People's Party said it would appeal to the Constitutional Court.

"This is a Black Revolution. The head scarf is a political symbol," said lawmaker Canan Aritman. "We will never allow our country to be dragged back into the dark ages."

Nesrin Baytok, another Republican legislator, said approval of the law "would turn Turkey into Afghanistan" in a domino effect.

"You are not opening the door of freedom — you are shutting it forever for the girls," Baytok said. "The heads of many girls are shaved by their brothers to force them to wear head scarves."

A week ago, some 125,000 Turks protested against lifting the ban on head scarves.

Analysts cautioned that the move threatens to spark tensions with the secular establishment.

"We are really entering an environment of conflict no matter what the decision of the Constitutional Court would be," Prof. Yilmaz Eser of the Istanbul-based Bahcesehir University told CNN-Turk television.

Islam and secularism have vied for dominance in the country since Mustafa Kemal Ataturk founded modern Turkey in 1923.

Ataturk sought to eliminate religion's place in a society with a 99-percent Muslim population by banning religious garb and changing the alphabet from the Arabic of the Quran to Latin. Secularism became a deeply ingrained ideology, with the military and judiciary as its key protectors.

Erdogan, who has strong public backing, insists his party is loyal to Turkey's secular traditions. His government says the measure is aimed at expanding democracy and freedoms as part of Turkey's EU membership bid.

But secularists harbor deep suspicions about the real intentions of Erdogan, who tried to criminalize adultery before being forced by the EU to step back.

Many secular women fear that allowing head scarves in universities will lead eventually to their being pressured to cover their bodies as well.

"The public will come under an intense pressure," legislator Baytok said. "This is an exploitation of religion. This law does not bring a solution; it leads the way to bigger problems."

Erdogan is head of modern Turkey's first Islamic-led government, and Gul's wife, who was prevented from enrolling in university because of her head scarf, now hosts foreign dignitaries at the presidential palace.

The government says once the constitutional amendments are enacted, it plans to change laws governing higher education to specify what type of head covering will be allowed to ensure that students do not attend classes in full-length chadors or burqas.

Erdogan's party and the Nationalist Action Party agreed that scarves should be tied loosely with a knot beneath the chin, keeping the face exposed.

That attire, accepted in military barracks and guesthouses and not necessarily associated with Islam, is seen as a move to undercut the military's opposition to lifting the ban.

In Turkey, most pious women prefer a style called the "turban" — or "hijab" in Arabic — with scarves tightly wrapped around the neck over a type of bonnet covering the hair.