Sunday marks Mexico’s largest national election ever, with nearly 2,000 electoral seats up for grabs. Voters will choose mayors, governors, local council officials and federal lawmakers that will help determine how far President Enrique Peña Nieto’s reform-oriented agenda will go in the latter half of his term. But the vote will also be a referendum on Peña Nieto himself, as his government’s been badly bruised over scandals, widespread disaffection and a streak of violence in the pre-election season.

All 500 seats in Mexico’s lower house of Congress are up for election, along with nine gubernatorial spots, more than 800 mayoral positions and a slew of local council seats. The vote will test some of the major electoral reforms put into effect last year, including a newly created election oversight body, and the first-ever inclusion of independent candidates on the ballot.

There are only 138 independents running -- and they have far fewer resources than their competitors -- but the presence of independent candidates at all is a significant step for Mexico’s democracy. It’s also generated excitement in the gubernatorial race in Nuevo León state, where Jaime Rodriguez, a folksy, often profane, unaffiliated candidate nicknamed “El Bronco,” is polling neck-and-neck with his main competitor, Ivonne Alvarez of the ruling Institutional Revolutionary Party (PRI).

Out of the pool of independent candidates he’s the only one considered to have a real shot at victory. And a win for Rodriguez, a former PRI politician who rejected the party and now draws support from those disillusioned with traditional Mexican politics, would reverberate across the country, analysts say.

“Marches and demonstrations don’t really have an effect,” Luis Carlos Ugalde, a former election commissioner in Mexico, told the New York Times. But, he said, a loss for the PRI in Nuevo León would shake the ruling party. “A triumph by El Bronco would be an important symbol.”

On the federal level, recent polls show Peña Nieto’s PRI party will likely remain ahead in the legislative elections. But it won’t likely win a majority – no single party has held a majority in the lower house of Congress in the past 15 years – and the makeup and partnerships of the rest of the body will determine how parties will wield power in the chamber and shape laws in the coming years.

A good showing for the PRI and its allies in the federal elections will make it easier for Peña Nieto to pass through the rest of his much-touted structural reforms. His presidency has already been marked by landmark legislation that opened up Mexico’s energy sector to private investors for the first time in decades. He has also curbed the power of monopolies in the telecommunications sector and instituted a sweeping anti-corruption system, among other things. But lawmakers will still need to work out a number of secondary laws on many of those reforms in the coming years, which will shape the rules around their implementation.

Last week the government suffered a blow on one of its main agenda items: education reform. The government suspended a reform measure to institute teachers’ evaluations, a move widely seen as bowing to pressure to a restive teachers’ union that had vehemently opposed the plans. Thousands of teachers took to the streets this week to continue protesting against education reform, accentuating what critics saw as the government’s moment of weakness.

It was the latest in a series of dents to the credibility of Peña Nieto and his government. Scandals and corruption allegations have swirled around the president, particularly reports that the first lady’s controversial $7 million mansion was owned by a construction company that had previously won several lucrative government contracts. The allegations eventually prompted her to sell the mansion, even though she maintained there was no wrongdoing.

Last year’s disappearance of 43 students in the southern state of Guerrero also continues to cast a shadow over the elections. Relatives of the missing students have been promoting a boycott of the elections in Guerrero as a protest against connections between politicians and organized crime that they say are endemic in the state.

Meanwhile, this campaign season has also become one of Mexico’s bloodiest. Seven candidates have been killed so far in the run-up to Sunday’s election through drive-by shootings and, in one particularly gruesome case, beheading. But violence hasn’t been limited to the candidates. Mexican newspaper Reforma reported that at least 70 attacks have been directed against campaign workers, political leaders or supporters of certain candidates.

Between scandals, violence and longstanding weariness with Mexico’s political system, it’s not surprising that political disaffection is widespread. According to a poll released Wednesday by the GEA-ISA companies, 67 percent of Mexicans are unhappy with the state of the country's democracy, and there has been a brewing debate among citizens over whether to turn in a blank ballot as a sign of protest. (One survey by polling firm Parametria showed that only one in ten Mexicans are seriously considering the null vote option, however.) Around 50 percent of eligible voters are expected to turn out Sunday, but political disillusionment – and dissatisfaction with Peña Nieto, whose approval ratings stand at less than 40 percent – will continue to plague the president well after the vote.