Mexico City: Mexico's ruling Institutional Revolutionary Party (PRI) limped to victory in a key state election on Sunday, according to preliminary projections of results that were quickly challenged by the leftist party beaten into second place.
The party, however, was heading for a loss in one state and struggling in another.
The putative win in the State of Mexico was a close call for President Enrique Pena Nieto's PRI, which has governed it for nearly nine decades. It will not end the aspirations of leftists led by Andres Manuel Lopez Obrador, an early favourite for next year's presidential race.
Despite its apparent victory against a party that was only founded three years ago, the PRI still has to battle widespread anger at corruption and rising violent crime under Pena Nieto as the countdown starts for the July 2018 presidential election.
However, the peso reversed earlier losses and gained 0.59 per cent on the setback for Lopez Obrador, a sign of ongoing market distrust of the leader who has opposed economic liberalisation in Mexico.
With 83 per cent of returns in from polling booths, PRI candidate Alfredo del Mazo had 33.0 per cent of the vote compared with 31.2 per cent for Delfina Gomez, the candidate of Lopez Obrador's National Regeneration Movement (MORENA).
An official early count projection from the state's electoral institute said del Mazo would end up winning between 32.75 per cent and 33.59 per cent of the vote. Gomez was seen taking no more than 31.53 per cent.
Lopez Obrador called the quick count "a farce" and said he did not accept it, while Gomez insisted she had won the election.
Lopez Obrador has alleged fraud in past elections, and he vowed to scrutinise the results from every voting booth.
"We will never resort to violence, but we are going to firmly defend this country's democracy," he said in a video message.
Prosecutors are investigating piles of pig heads left on Saturday in several municipalities in the state as well as telephone threats and fake electoral literature warning of attacks -- tactics used to dissuade people from voting.
Encompassing many populous neighborhoods on the edge of Mexico City, the State of Mexico is home to one in eight Mexican voters and it has long been a source of strength and financing for the PRI.
However, del Mazo is projected to have won with barely half the share of vote that the current governor won six years ago with the backing of Pena Nieto, himself a former governor of the state whose own popularity has since plunged.
Failing to put a stop to corruption scandals and struggling to tame brutal gang violence has cost the party dearly.
Mexico's attorney general's office said on Sunday a former state governor for the PRI, Roberto Borge, had been arrested at Mexico's request in Panama on corruption charges. He has previously denied wrongdoing.
In another gubernatorial election on Sunday, the PRI was headed for a decisive loss to an opposition coalition in Nayarit, after a senior security official from that state was arrested in the United States on drugs charges in March.
The party was also struggling to retain the northern state of Coahuila. One of the PRI's recent governors in the border region is wanted on corruption charges in the United States.
The loss of Nayarit would leave the PRI with six fewer governors than when Pena Nieto took office.
Going into Sunday, the PRI and its allies controlled 16 states, or half the regional governments.
Lopez Obrador's State of Mexico campaign was hurt by a failure to ally with others in the opposition and references by rivals to crisis-hit Venezuela, which the PRI argues mirrors his economic model. He denies the accusation.
The silver-haired campaigner has opposed the opening of Mexico's energy sector to private capital, a key reform under Pena Nieto, but no longer vows to reverse it.
Linking Lopez Obrador to former Venezuelan President Hugo Chavez has helped rivals beat him to the top job in two previous bids at the presidency.
Victory for Lopez Obrador in 2018 could push Mexico in a more nationalist direction at a time of tension with the United States, with U.S. President Donald Trump riling Mexicans with threats to tear up the North American Free Trade Agreement and build a border wall.