Claudia Sheinbaum was elected Mexico's first woman president by a landslide Sunday, making history in a country plagued by rampant criminal and gender-based violence.
Flag-waving supporters sang and danced to mariachi music in celebration of the ruling party candidate's victory, in a nation where around 10 women or girls are murdered every day.
"I want to thank millions of Mexican women and men who decided to vote for us on this historic day," Sheinbaum told the cheering crowd.
The 61-year-old former Mexico City mayor thanked her main opposition rival Xochitl Galvez, who conceded defeat.
Sheinbaum, a scientist by training, won around 58-60 percent of votes, according to preliminary official results from the National Electoral Institute, which estimated turnout at 60 percent.
That was more than 30 percentage points ahead of Galvez, and some 50 percentage points ahead of the only man running, centrist Jorge Alvarez Maynez.
Maria de los Angeles Gordillo, a 37-year-old member of the Tojolabal Indigenous community, said she was moved to tears as she listened to Sheinbaum speak.
"I'm here to celebrate this historic moment for our country and especially for women who carry these inequalities on their skin," she said.
Voters had flocked to polling stations across the Latin American nation, despite sporadic violence in areas terrorized by ultra-violent drug cartels.
Thousands of troops were deployed to protect voters, following a particularly bloody electoral season that saw more than two dozen aspiring local politicians murdered.
"Our society is violent, sexist, misogynistic and Dr. Sheinbaum as president will really be able to help change not only the laws but society," said Lol-Kin Castaneda, 48, who waited late into the night to hear the winner speak.
"Mexico can't stand any more violence," she added.
- 'Transformation' -
Women going to the polls had cheered the prospect of their favored candidate breaking the highest political glass ceiling.
"A female president will be a transformation for this country, and we hope that she does more for women," said Clemencia Hernandez, a 55-year-old cleaner in Mexico City.
"Many women are subjugated by their partners. They're not allowed to leave home to work," she said.
Daniela Perez, 30, said that having a woman president would be "something historic," even though neither of the two main candidates was "totally feminist" in her view.
Nearly 100 million people were registered to vote in the world's most populous Spanish-speaking country, home to 129 million people.
Sheinbaum owes much of her popularity to outgoing President Andres Manuel Lopez Obrador, a fellow leftist and mentor who has an approval rating of more than 60 percent but is only allowed to serve one term.
Lopez Obrador congratulated his ally with "all my affection and respect."
As well as being the first woman to lead Mexico, "she is also the president with possibly the most votes obtained in the history of our country," he said.
In another win for the ruling party, its candidate Clara Brugada was elected mayor of Mexico City, one of the country's most important political jobs, preliminary results showed.
- 'Hugs not bullets' -
In a nation where politics, crime and corruption are closely entangled, drug cartels went to extreme lengths to ensure that their preferred candidates win.
Hours before polls opened, a local candidate was murdered in a violent western state, authorities said, joining at least 25 other political hopefuls killed this election season, according to official figures.
In the central Mexican state of Puebla, two people died after unknown persons attacked polling stations to steal papers, a local government security source told AFP.
Voting was suspended in two municipalities in the southern state of Chiapas because of violence.
Sheinbaum has pledged to continue the outgoing president's controversial "hugs not bullets" strategy of tackling crime at its roots.
Galvez had vowed a tougher approach to cartel-related violence, declaring "hugs for criminals are over."
More than 450,000 people have been murdered and tens of thousands have gone missing since the government deployed the army to fight drug trafficking in 2006.
The next president will also have to manage delicate relations with the neighboring United States, in particular the vexed issues of cross-border drug smuggling and migration.
As well as choosing a new president, Mexicans voted for members of Congress, several state governors and myriad local officials -- a total of more than 20,000 positions.