MEXICO CITY (Reuters) - The window for a new NAFTA trade deal before Mexico’s July presidential election is closing, and with it, the chances for the ruling party to claim a win in its battle with U.S. President Donald Trump and bolster its bid to retain power.

FILE PHOTO: U.S. Trade Representative Robert Lighthizer embraces Mexican Economy Minister Ildefonso Guajardo during a joint news conference on the closing of the seventh round of NAFTA talks in Mexico City, Mexico March 5, 2018. REUTERS/Edgard Garrido/File Photo

President Enrique Pena Nieto has devoted considerable energy to trying to counter Trump. The American president took office vowing to rebalance trade at Mexico’s expense, blaming the country for many of the United States’ problems, threatening to pull out of NAFTA and promising to make Mexico pay for a U.S. border wall.

The North American Free Trade Agreement (NAFTA) underpins the bulk of Mexico’s trade, and lobbying of U.S. policymakers by Mexican leaders has helped keep alive talks to rework the 1994 accord longer than some skeptics anticipated.

However, Trump has issued threats against NAFTA throughout, linking the ongoing renegotiation to Mexico paying for the wall, and suggesting the country would not avoid punitive tariffs on steel and aluminum unless a “fair” deal was agreed.

The NAFTA talks have made slow progress since starting in August, with only a few chapters concluded amid resistance from Mexico and Canada to tough U.S. demands aimed at slashing the country’s trade deficit with its neighbors.

With the fraught negotiations about to spill into the election campaign, Mexico’s ruling Institutional Revolutionary Party (PRI) has less room to respond vigorously to Trump’s provocations than its political rivals.

Enrique Jackson, a PRI lawmaker, said Trump’s NAFTA maneuvers played into the hands of the front-runner to succeed Pena Nieto, opposition leftist Andres Manuel Lopez Obrador.

Because he has no responsibility for the negotiation, Lopez Obrador can criticize the government on NAFTA and promise to fix things once he becomes president, Jackson said.

“The fact is we have very knowledgeable, experienced people, but they’re up against this capricious, closed and authoritarian stance of Trump,” he told Reuters.

“Reason does not prevail when you’re looking for someone to pay the cost. And so it’s the government that pays the cost. And the government is the PRI,” he added.

Lopez Obrador, who has vowed to put Trump “in his place” if elected in July, was ahead of the third-placed PRI candidate Jose Antonio Meade by nearly 20 percentage points, according to a poll by newspaper Reforma published in mid-February.

Slideshow ( 2 images )

Meade, a former finance minister with no formal party affiliation, has been weighed down by Pena Nieto’s legacy.

A steady stream of scandals have solidified the PRI’s reputation for corruption, and Pena Nieto’s failure to curb gang violence or meet his economic growth targets have eroded support for the once-dominant party.

Mexican law bars Pena Nieto from seeking re-election. Most polls put Ricardo Anaya, a former leader of the center-right National Action Party (PAN) who heads a right-left coalition, in second place.

ELECTORAL HURDLES

Jorge Buendia, head of polling firm Buendia & Laredo, said if Pena Nieto could strike a deal on NAFTA, it would probably deliver at least a short-term boost to the PRI.

However, the government is more vulnerable to downside risk, he argued. “People are more sensitive to what they lose than what they gain,” Buendia said.

Pena Nieto pitched his presidency on a platform of economic liberalization, earning plaudits from U.S.-based investors.

He and Meade have sought to frame the election as a referendum on those reforms, which ranged from ending a decades-long state oil monopoly to taking steps to loosen billionaire Carlos Slim’s hold on the telecommunications market.

Yet Trump’s nationalist posturing at Mexico’s expense has undercut that message, fanning the appeal of Lopez Obrador’s pledge to reduce Mexico’s dependence on foreign powers.

Wedded to a liberal economic vision, Pena Nieto has limited scope to hit back against Trump. Mexico depends heavily on U.S. firms for foreign investment, and 80 percent of its exports are sold to its northern neighbor.

With Trump branding NAFTA a U.S.-job-killing “disaster,” Mexican officials have been circumspect about the chances of quickly renegotiating the accord.

After the latest round of NAFTA renegotiations, U.S. Trade Representative Robert Lighthizer on Monday sought to accelerate the talks, floating the idea of agreeing a deal “in principle” in coming weeks before electoral hurdles move center stage.

Mexican Economy Minister Ildefonso Guajardo offered support, arguing those weeks should be used to narrow differences on the thorniest issues.

However, four participants at the talks consulted by Reuters were skeptical about a quick fix and said the renegotiation could extend into 2019, assuming Trump remained committed.

Guajardo himself said a deal was not dependent on “political calendars” and that the administration would keep negotiating until Pena Nieto’s term ends on Nov. 30 if necessary.

Even if a preliminary accord can be reached, Trump will likely continue to attack Mexico in the run-up to the U.S. mid-term elections in November, said Juan Carlos Romero Hicks, a member of the Mexican Senate’s foreign relations committee.

“He’s got an electorate he’s going to cultivate from here to the first Tuesday of November, and it’s about fear of Mexico, jobs, and so on,” Romero said. “He’s a bully. He thinks everything gets done this way, by making threats.”