The Quebec government will introduce emergency legislation that would suspend the school semester for striking students in an effort to end months of violent protests over tuition increases across the province.

The news was met with yet another demonstration by students, who marched in Montreal into the wee hours of Thursday.

The bill would temporarily halt the spring semester in post-secondary institutions affected by the boycotts -- 14 CEGEPs (the province's public colleges) and 11 universities.

The students would take an early summer holiday and return in August to finish their spring classes before the fall semester begins in October.

"It's time for calm to be restored," Premier Jean Charest said at a Wednesday night news conference, hours after about 100 protesters stormed classes at the Universite du Quebec a Montreal, confronting students and professors.

The Liberal government's bill would guarantee access to education in the province, Charest said. He did not address reports that the legislation may impose hefty fines on those who try to block students from attending classes.

"Access to education is a right," Charest said. "Nobody can pretend to defend access to education and then block the doors of a CEGEP or university."

New Education Minister Michelle Courchesne said she fruitlessly tried to negotiate with student leaders before giving her assessment of the situation to the provincial cabinet on Wednesday.

"There is no openness to make the necessary compromises," she said.

As soon as the emergency measures were announced, late-night protests were organized in Montreal. Thousands of demonstrators spilled into the streets and marched peacefully until a few stragglers began breaking shop windows. When police moved in they threw bottles and other projectiles at officers.

Police used pepper spray to subdue the crowd.

Some students and activists took to social media, vowing to fight Charest's "special law."

"If there is violence, if there are serious injuries, Premier Jean Charest will have to carry the blame for the rest of his political career," Leo Bureau-Blouin, president of the Quebec federation of college students, told reporters late Wednesday.

Earlier Wednesday, a band of protesters stormed the Universite du Quebec a Montreal, shouting and banging on drums. Many covered their faces with masks or bandanas.

When some of the students attending UQAM classes tried to record the chaotic scene with their cell phones, the protesters tried to intimidate them and grab their phones, one law student said.

"We're going to bring them to court. We really don't care," Christina Macedo told reporters outside. "(The protest) was not peaceful at all."

At one point, a few dozen demonstrators entered a full classroom and began flicking the lights on and off, yelling, "Scab!" at the students seated inside.

A few men grabbed two female students by the arm, telling them to get out. Some in the group jumped on desks and chairs.

None of the protesters were carrying weapons and police said no one was hurt.

Although only one-third of Quebec students are actually on strike, demonstrations have intensified in Montreal and other cities. On Monday, Line Beauchamp resigned as education minister and gave up her seat in the National Assembly, saying she was no longer part of the solution.

For 14 weeks, students have been demonstrating against planned tuition increases of $325 annually for five years.

Parti Quebecois Leader Pauline Marois has made it clear that she would oppose any legislated crackdown.

With files from The Canadian Press and a report from CTV Montreal