Residents of Tixtla, in Guerrero state, attack a pickup carrying students who wanted to halt the election there. (Pedro Pardo/Agence France-Presse via Getty Images)

Millions of Mexicans marched to the polls Sunday to vote in midterm elections, but Vicente Melchor was not among them.

Sitting on a piece of cardboard under a blue rain tarp in the stone colonial plaza here, Melchor, a 58-year-old elementary school teacher of indigenous languages, would be waiting this one out.

“These elections are a farce, nothing more,” he said. “They won’t resolve Mexico’s problems.”

Although polls opened in the state, Melchor and thousands of other teachers in this southern city, known for its exquisite cuisine and rowdy politics, chose to boycott the vote. Over the past week, the powerful teachers union and its followers have seized election offices, the airport and gas stations, putting at risk the election in this state.

In several states, protesters Sunday burned ballot boxes and voting materials in an attempt to disrupt the vote. In Tixtla, a town in the volatile state of Guerrero, there were reports that authorities canceled the city election after more than half of the ballot boxes were stolen. In Oaxaca, protesters also set fires in some places, and the Organization of American States suspended its observer mission because of security risks. But election officials said the vast majority of polls in the country opened without incident.

Members of a teacher's union prepare to burn electoral materials in downtown Oaxaca, Mexico, on June 7. Dozens of ballot boxes were burned by activists in Guerrero and Oaxaca states, two of Mexico's most restive. (Jorge Luis Plata/Reuters)

The crisis in Oaxaca, one of the country’s poorest states, has been one flash point in a constellation of turmoil surrounding the elections. Beyond threats of boycott, there have been grenades thrown at electoral offices, hundreds of thousands of ballots stolen, and several candidates slain. The federal government deployed soldiers and federal police to try to secure the election in Oaxaca and other volatile southwestern states — Guerrero, Chiapas, and Michoacan. A presidential spokesman, Eduardo Sanchez, told reporters that “Mexicans have the right to vote in peace.”

Across the country, the midterm elections pose a difficult test for President Enrique Peña Nieto and his ruling Institutional Revolutionary Party, or PRI. After a fast start to his six-year term, with constitutional changes that opened up the country’s oil industry and reformed public education and the electoral system, his popularity has flagged and his government has suffered from persistent drug gang violence and corruption scandals.

Sunday’s election will decide governorships in nine of Mexico’s 31 states. In most of those states, polls showed challengers to the PRI had a strong chance of winning. The PRI is also trying to maintain its slim majority in the 500-seat lower house of Congress.

The pre-election chaos and attacks against electoral institutions surpassed previous years, according to election officials.

“We don’t have precedent for such acts of violence against the electoral authority nor against the elections,” Ciro Murayama Rendon, counselor of the National Electoral Institute, said in an interview last week. “This has never happened.”

In Oaxaca, where citizens are voting on 11 congressional seats, the situation has been particularly tense. The teachers union has brought increasing political pressure to bear in an effort to undo constitutional reforms to the public education system, including a requirement for performance testing for teachers. Its followers had seized control of most of the state’s 12 electoral office buildings. They burned files, smashed furniture and spray-painted anti-election slogans such as “To vote is to change your master.”

“For the first time since the Mexican revolution, we are at risk of not being able to celebrate elections in a federal entity of Mexico. This is very worrying that this could happen in the 21st century,” Murayama said four days before the vote. “The only moment when Mexicans are equal is in front of the polls. We’re not equal in front of the judge, in front of the police, in opportunities for education, in access to health care. And it’s very lamentable that this exercise of the rights that allow for equality is at risk, particularly in the poorest parts of the country.”

A Mexican federal policeman stands guard during the election in Chilpancingo, Guerrero state, Mexico on June 7. (Jesus Guerrero/AFP/Getty Images)

Over the past week, the teachers’ supporters also seized a distribution facility of the state oil company, Pemex, cutting off the supply at gas stations. Drivers waited in lines for several hours at many stations until the gas was exhausted.

“Is there gas around here?” Jesus Bautista, a 37-year-old taxi driver, shouted out the window to a colleague on Saturday.

“No, buddy.”

Bautista said that the chaos surrounding the gasoline shortage had sapped public support for the teachers’ movement, but there is also acute frustration with political elites.

“The lawmakers don’t legislate in favor of the people,” he said. “They’re the representatives of the upper class, of businessmen who don’t pay their taxes. As citizens, this affects us dearly.”

The conflict between teachers and the government goes back years. In 2006, the government sent in soldiers and police to wrest control of the central plaza from striking teachers who had camped out there for months demanding pay raises. For more than two years, the teachers union here has protested and occasionally gone on strike to oppose constitutional reforms that would require evaluations of teachers.

Last month, the government announced these tests would be suspended indefinitely, but the union submitted more demands, including salary increases and the return, alive, of the 43 teachers’ college students who went missing last fall in the state of Guerrero and are widely believed to be dead.

“We have arrived at the conclusion that all the politicians are the same, that the politicians don’t represent the interests of the people,” Eligio Gomez, a union leader, told a large crowd gathered in the central plaza under a drizzling rain Saturday night. “Tomorrow, we will abstain from the polls. We are not going to vote. We won’t be fooled, comrades.”

“The people have to look for their own form of government and their own form of autonomy,” he said.

Teachers who were camped out in the tent city listed many grievances. Some earn just a few hundred dollars a month and want raises. Others complain that the government does not spend enough to supply or maintain the schools, forcing parents to pay fees each semester.

“There aren’t enough classrooms, furniture, teachers,” Mel­chor said.

He has been a veteran of teachers’ battles since 2006, when he camped in the plaza for months and manned street barricades made of rocks and logs. He has walked 300 miles to Mexico City to protest. For the latest struggle, he has lived in the plaza since June 1 with other teachers from his village of San Pablo Guila. As military helicopters circled overhead, Melchor said the struggle would not end with the election.

“We don’t know when we’ll return home,” he said.