MEXICO CITY — Mexico’s ruling party managed to hold onto the governorship of the country’s largest state, according to near-complete election results on Monday – which their leftist rivals rejected, vowing a fight.

With 97.7 per cent of the ballots counted in the crucial state of Mexico, Alfredo del Mazo of the Institutional Revolutionary Party (PRI) had 33.7 per cent of the vote to 30.8 percent for his top rival, Delfina Gomez of the National Regeneration Movement (Morena).

The election in the central state of 16 million people, Mexico’s wealthiest, was being closely watched as a bellwether ahead of presidential polls next year.

It was a must-win race for President Enrique Pena Nieto and the PRI, whose popularity has been badly damaged by corruption scandals, violent crime and a lackluster economy.

They had to fend off a fierce challenge from Morena and its founder, Andres Manuel Lopez Obrador – widely known by his initials, AMLO – a fiery populist who is hoping to become Mexico’s first leftist president in recent memory.

Lopez Obrador rejected the preliminary results.

"According to our results, Delfina won," he said in a video posted online Sunday night. "We will accept no fraud."

Street protests and court challenges may follow – though Morena did not rush to counter-attack. Gomez said Monday her side would wait for the full official count before deciding how to proceed.

Even though the PRI eked out a victory, the damage may already be done, political analysts said.

Morena, which has never held a governorship, was never supposed to come this close to power in the ruling party’s bastion, which it has held for more than 80 years.

Lopez Obrador remains "the candidate to beat" next year, said political analyst Hector Aguilar Camin.

"AMLO," whose enemies say he would lead Mexico down the same path as socialist Venezuela, has a history of fighting long after the voting is done.

After an unsuccessful 2006 presidential bid, he proclaimed himself the "legitimate president" as his supporters camped out for weeks in central Mexico City. — AFP