MEXICO CITY -- Mexico held the last day of campaigning Wednesday before Sunday's nationwide election, but the closing rallies were darkened by attacks on candidates and the country's persistently high homicide rate.

Opposition candidate Xochitl Galvez started her last campaign rallies early Wednesday on the outskirts of Mexico City, and she focused her ire on President Andres Manuel Lopez Obrador's "hugs not bullets" policy of not confronting the drug cartels.

Galvez is facing the candidate of Lopez Obrador's Morena party, former Mexico City Mayor Claudia Sheinbaum. Sheinbaum, who leads in the race, has promised to continue all of Lopez Obrador's policies.

"Are we going to continue with hugs, or are we going to apply the law to criminals?" Galvez asked a cheering crowd. "Mexico wants peace, wants tranquility."

Lopez Obrador has withdrawn funding for police forces and directed it to the quasi-military National Guard, which critics say lacks the professional and investigative abilities needed to fight the drug gangs. Galvez promised to return the funding to police forces and guarantee them wages of at least US$1,200 per month.

Galvez also pledged to reconcile a country that has been highly polarized by the outgoing president's rhetoric, saying "enough division, enough hatred ... we are all Mexicans."

Sheinbaum held her final rally later Wednesday in Mexico City's vast, colonial-era central square. She delivered a strongly nationalistic speech to a large crowd.

"Mexico is respected in the world, it is a reference point," Sheinbaum said, claiming that Lopez Obrador's government "has returned to us the pride of being Mexicans."

"Mexico has changed, and for the better," she said.

On the violence issue, Sheinbaum vowed to continue Lopez Obrador's policy of offering apprenticeships to encourage youths not to join drug cartels.

"We will deepen the strategy of peace and security, and the progress that has been made," she said. "This is not an iron fist" policy, Sheinbaum said. "This is justice."

While Lopez Obrador has increased the country's minimum wage and increased government benefit programs, he has been unable to significantly reduce the historically high homicide rate, which currently runs at more than 30,000 killings per year nationwide. That gang-fuelled violence has also cast a shadow over the campaigns.

Late Wednesday, a mayoral candidate in the violent southern state of Guerrero was shot to death in the town of Coyuca de Benitez. Gov. Evelyn Salgado identified the dead candidate as Alfredo Cabrera, but gave no further details on his killing. Local media reported he was shot in the head at his closing campaign event.

A mayoral candidate in the western state of Jalisco was shot multiple times by intruders in his campaign offices late Tuesday. Two members of Gilberto Palomar's campaign staff were also wounded, and all three were hospitalized in serious condition, according to Jalisco state security coordinator Sanchez Beruben.

Mexicans will vote Sunday in an election weighing gender, democracy and populism, as they chart the country's path forward in voting shadowed by cartel violence. With two women leading the contest, Mexico will likely elect its first female president. More than 20,000 congressional and local positions are up for grabs, according to the National Electoral Institute.

Gunmen killed an alternate mayoral candidate in Morelos state, just south of Mexico City on Tuesday, state prosecutors said.

Local media reported attackers on a motorcycle shot Ricardo Arizmendi five times in the head in the city of Cuautla in Morelos. Alternate candidates take office if the winner of a race is incapacitated or resigns.

About 27 candidates, mostly running for mayor or town councils, have been killed so far this year. While that is not much higher than in some past elections, what is unprecedented is the mass shootings: candidates used to be killed in targeted attacks, but now criminals have taken to spraying whole campaign events with gunfire.