At least 100 people have been arrested in Montreal as the latest in a series of protests against a planned rise in student tuition fees turned ugly.
The main protest passed peacefully as tens of thousands of people filled the streets of Quebec's largest city.
But trouble broke out in the evening as some students began throwing bottles and lighting fireworks, police said.
Authorities invoked an emergency law passed on Friday by Quebec's government that aims to curb the protests.
Bill 78 requires marches to follow pre-approved routes, but protesters say it infringes their democratic rights, and have pledged to contest it in court.
Since the legislation was passed, rallies have turned more unruly, with 300 arrests on Sunday alone.
Quebec has the lowest tuition rates in Canada. The government's proposal would raise them by 80%, in increments of $254 per year (£160) for seven years.
Those attending Tuesday's rally - held to mark 100 days since protests began - began by following a route submitted to police in advance, in accordance with the emergency bill.
But many of the demonstrators chose to defy the law and broke away from the planned route.
People carrying signs and red banners chanted: "Whose streets? Our streets!"
Police declared illegal a later protest by a splinter group of students, and used pepper spray as trouble flared.
During Tuesday night's disorder, two police officers were injured, and four people were taken to the hospital, although it is unclear if anyone was seriously hurt.
Classe, a hardline student group, said it would continue to agitate through the summer, a time of year when Montreal hosts outdoor festivals and attracts large numbers of tourists.
"Thousands of people have come to demonstrate with us, not only against the rise in tuition rates but with the intention to signal their disapproval of the special law," Classe spokesman Gabriel Nadeau-Dubois told the Associated Press news agency.
"The gesture made by tens of thousands is one of massive and collective civil disobedience."
But Quebec's minister of public safety, Robert Dutil, countered that many cities - including Geneva, New York, Los Angeles and Toronto - have implemented comparable legislation.
"Other societies with rights and freedoms to protect have found it reasonable to impose certain constraints, first of all to protect protesters, and also to protect the public," Mr Dutil told reporters.
The bill requires activists to provide the police with eight hours' notice of when and where protests are planned to take place, or face heavy fines.
Small protests took place in New York and Paris on Tuesday in solidarity with the movement in Montreal.
In Quebec, the provincial government has not backed away from the proposed increases of tuition fees, and Premier Jean Charest has been criticised by opposition parties for his handling of the protests.
Mr Charest must call an election before 2013.