Updated

Turkish lawmakers on Friday approved a hotly contested school reform bill that detractors say will increase the influence of Islamic schools and which has reignited tensions between the Islamic-leaning government and opponents who fear the country's secular ideals are in danger.

Turkey is a Muslim majority nation that also has a strong secular tradition. The school reform bill comes at a time when Prime Minister Recep Tayyip Erdogan's Islamic-rooted government is shifting power away from the secular establishment, including the military, that once dominated the country.

The bill prompted such passions that scuffles broke out among lawmakers debating it.

The government-backed proposal, which snagged 295 votes in the 550-member Parliament, extends compulsory education from the current eight years to 12, but also paves the way for middle school students to attend Islamic schools.

It reverses a move that was imposed by the military back in 1997 that closed religious middle schools, allowing only high school students to attend such institutions. The schools had long been viewed by the military as breeding grounds for Islamist groups.

Under the bill, students are also given the option of attending vocational schools as early as age 10, a move opponents say will devoid students of the broad-based education they need.

The bill needs to be approved by President Abdullah Gul, an ally of the government, before it comes into effect.

Erdogan, the prime minister, is a graduate of an Islamic school and has spoken of government aims to raise a "pious generation."

His government, which has a majority in Parliament, insists the reforms will raise school standards and reduce illiteracy. It has defended the reopening of the religious middle schools, arguing that it was responding to widespread public demand and overturning undemocratic moves imposed by the military.

"This law will go down in history as an important step toward the reconciliation of the state with its people," Education Minister Omer Dincer told Parliament in a speech after the vote.

Opposition parties say they support school reforms but argue that the students must be provided with broad-based education while in middle school. They have accused the government of trying to erase all traces of the 1997 move as an act of "revenge."

Much of their anger focused on the fact that the ruling party rushed the bill through Parliament without allowing much time for public debate.

Discussion over the bill in Parliament were so tense that a legislative committee meeting on the reforms resulted in a fight, with one ruling party legislator even accusing the opposition of throwing a heavy tape dispenser at him.

At one point, an opposition lawmaker addressed the committee for a record 12-hours in a rare filibuster in Turkey's parliament. Fighting also broke out during a debate in the full house.

Thousands of people joined an opposition rally against the bill this week, while police on Thursday used tear gas to disperse trade-union groups who attempted to march to the Parliament building to protest the bill.