- NEW: Polls have closed throughout Mexico
- NEW: Voters say economy and security are top issues
- Voters cast ballots for federal, state and local offices
- Authorities call it the "largest and most complex election day" in Mexico's history
Follow the Mexican election coverage in Spanish at CNNMéxico.com
Mexico City (CNN) -- Mexican election authorities were tallying votes Sunday night in a key election that will decide the country's next president and many other top political leaders.
Four candidates were vying for the presidency in what officials called "the largest and most complex election day" in the country's history.
A quick count based on nationwide polling samples was expected late Sunday night.
Before Sunday's vote, Enrique Peña Nieto of the Institutional Revolutionary Party (PRI) had a strong lead in numerous polls.
A victory for Peña Nieto would mark a triumphant return to power for the PRI, which controlled Mexico's presidency for more than 70 years, until the election of the PAN's Vicente Fox in 2000.
Criticisms of Peña Nieto and concerns about the PRI's possible return to power have fueled a student movement that has staged protests throughout the country in recent weeks.
But the charismatic 45-year-old former governor has also galvanized fervent support among residents of his home state and party loyalists nationwide.
The frontrunner's campaign platform includes plans to stop the rise in food prices, promote energy reform, give social security to all Mexicans and reduce violence nationwide.
Polls before the election placed Andres Manuel Lopez Obrador of the Democratic Revolution Party (PRD) in second place.
In the 2006 presidential vote, election authorities said the former Mexico City mayor narrowly lost to Calderon. Lopez Obrador claimed election fraud and never conceded, referring to himself as "the legitimate president of Mexico."
On Wednesday, he told throngs of supporters that he was confident that he would "win the presidency again."
Ruling party candidate Josefina Vazquez Mota, who would be Mexico's first female president if she wins, has been trailing in polls.
Throughout the three-month campaign, she appeared to be distancing herself from President Felipe Calderon. Her campaign slogan was "Josefina Diferente."
But at a campaign rally Wednesday night, the National Action Party (PAN) candidate praised the "valor" of Calderon's fight against organized crime and made a surprise announcement that she would invite him to be Mexico's attorney general if she wins the presidency.
Gabriel Quadri of the New Alliance, who lags far behind in polls, has pledged to bring about reforms in the country's prison system and make other structural changes.
In more than 143,000 polling centers throughout the country, workers began the day assembling cardboard voting booths marked with bold black letters saying, "The vote is free and secret."
But fears of fraud remained high.
From a command center in Mexico's capital, student activists tracked election irregularities reported in local media, and encouraged others to document activities at their neighborhood polling stations.
The monitoring effort was spearheaded by youth who have led a series of social media campaigns and street protests leading up to Sunday's vote.
At the Revolution elementary school near the heart of Mexico City, Martha Rojas Ramos was near the front of the line, waiting for the polls to open Sunday morning.
The 58-year-old flea market merchant, who carried bags of merchandise in her arms as she waited in line to vote before heading to work Sunday morning, said money was tight, and the economy was a key issue for her in this year's election. Peña Nieto, she said, is the right person to solve Mexico's economic problems.
"He is obviously prepared. There was obviously a dirty war against him," said Martha Rojas Ramos, 58.
Critics lamenting the possible return of the PRI to power aren't thinking straight, she said.
"That's all in the past. What's important is that he is young and has all the ability to represent us," she said.
Alejandro Garcia, a 33-year-old accountant, said he supported Peña Nieto's security strategy, which aims to decrease violence in Mexico.
"Now we are seeing things that we didn't see before. Maybe they were going on, but they weren't as open as they are now," he said. "I think he is the one to stabilize the country."
Other voters were less decisive about their choices.
"We are voting for the least bad candidate," said Manuel Palomera, a 34-year-old travel agent who said he was casting his ballot for Vazquez Mota.
At one polling station in Mexico City, a 46-year-old attorney from the state of Michoacan was fuming. Thalia Vasquez was one of hundreds of out-of-town voters who went to a special polling place to vote and had to wait for hours.
According to Vasquez, she arrived at one poll at 4 a.m., only to be told at 8 a.m. that she needed to go to a different polling place. By the time she arrived, the polling place hadn't opened, and there were already more than 100 people waiting in line. Shouting matches ensued when people tried to cut in line, she said.
"Imagine how long this is going to take," she said, saying election authorities should do more to monitor the lines outside the polls.
Voters still in line after polls close at 6 p.m. were allowed to vote, election officials said.
Mexicans also cast ballots from beyond the country's borders. On Saturday, election officials said they had received 40,737 absentee ballots from Mexicans living abroad.
For the first time, more than 79 million people were registered to vote, according to election authorities. Among them are 3.5 million young people who will be casting their first vote, the institute said.
More than 2,100 federal, state and local offices will also be decided by Sunday's vote, according to Mexico's Federal Election Institute.
Voters will elect new governors in the states of Chiapas, Guanajuato, Jalisco, Morelos, Tabasco and Yucatan. In Mexico City, the nation's capital, residents will elect a new mayor.
Online and on the streets, Mexico youth protests grow as election looms
Are you voting today? Show us your thumb after voting.
CNN's Rafael Romo, Miguel Marquez, Krupskaia Alis and Rene Hernandez and CNNMexico.com contributed to this report.