Chilean police have arrested 122 people, many of them teenagers, after raiding secondary schools that had been taken over by their students.
The schools are due to be used as polling stations on Sunday when Chileans choose candidates for the presidential election in November.
The occupation was part of a two-year campaign calling for education reforms.
Police clashed with students in the capital Santiago on Wednesday night after a national protest on Wednesday.
The violence was among the worst seen in Chile since the demonstrations began in 2011, the BBC's Gideon Long reports from Santiago.
The country's powerful student movement has staged major demonstrations over the past two years demanding free and improved education.
Sporadic school and university takeovers have been part of the campaign.
On Thursday, police launched pre-dawn raids on more than 20 schools across Santiago, where students had barricaded themselves in with tables and chairs. Local media broadcast footage of officers bursting into the buildings.
Interior Minister Andres Chadwick later said security forces had "restored order", adding that most of the evictions had been peaceful.
"As dialogue didn't yield expected results, and given that we are 72 hours away from the start of the primaries, as the government we had the obligation to avoid any disturbances," he said.
The raids came after a day and night of violence in Santiago.
More than 100 people were arrested and 10 police officers were injured after the city-wide demonstration, which drew tens of thousands of students, teachers and unionists.
Violence erupted when masked youths began to throw stones and Molotov cocktails at security forces who responded with tear gas and water cannon.
Although Chile's education system is regarded by many as one of the best in Latin America, students argue it is deeply unfair.
They say middle-class students have access to some of the best schooling in the region, while the poor have to be content with under-funded state schools. The country has no free universities.
The campaign for educational reform is the biggest protest movement Chile has seen since the return to democracy in 1990.