Teachers angered at education reform stormed the offices of political parties in southwestern Mexico on Wednesday, breaking windows and setting fire inside the ruling party's local headquarters.

Thousands of members of the CETEG teachers' union, joined by farmers and student groups, marched in the capital of Guerrero state, Chilpancingo, while groups wearing masks took their anger out on the offices of four political parties.

Plumes of black smoke billowed from the rectangular-shaped office of the ruling Institutional Revolutionary Party (PRI) in the state capital after masked protesters broke into the building and tossed chairs, papers and plants from windows.

Some spray-painted anti-government graffiti on the building, while others tore pictures of President Enrique Pena Nieto, who pushed through an overhaul of the nation's flagging education system with the backing of opposition parties.

The protesters used pipes and sticks to destroy windows and doors at the local headquarters of the National Action Party (PAN), the Democratic Revolution Party (PRD) and the Citizen Movement. Protesters wrote "traitors of the people" on the PRD's walls.

Milenio television also showed small fires inside the state education department's audit office, with computers and broken pieces of glass strewn on the parking lot. Firefighters were later seen dousing the flames.

Police did not intervene while some 300 police officers protected the state legislature.

Teachers have held protests in recent weeks, twice blocking the highway between Mexico City and the Pacific resort of Acapulco to denounce the reform that passed the federal Congress in December.

The latest demonstration erupted one day after the Guerrero state legislature approved an education bill that fell well short of protesters' demands to water down the federal law, which requires teachers to pass periodic tests to get jobs and promotions.

Minervo Moran, the CETEG union's spokesman, said the violent protests were "a reaction to the aggressive policies that are being imposed by the reforms and that's why there was this sort of action against the parties" that voted against the protesters' proposals.

Moran warned that the demonstrations "could escalate, but it is up to the government and the legislature to find a solution." He said the union would hold a meeting later in the day to decide the way forward.

PRI chairman Cesar Camaco condemned the attacks, telling Milenio that it was "a bad signal and this cannot remain unpunished."

Chilpancingo Mayor Mario Moreno asked for federal security support to control the situation.

"We as a municipality do not have the ability to face a mob of 4,000 or 5,000 people," Moreno told Milenio.

Meanwhile, students in schools to become teachers temporarily blocked two federal highways in the neighboring state of Michoacan, demanding that graduates from their college automatically get teaching positions.

Protests have also taken place in recent weeks in Oaxaca, which is among the country's poorest states along with Guerrero and Michoacan.