WASHINGTON — The Trump administration appears to be closing in on a deal on a revamped North American Free Trade Agreement, but is up against a very tight political deadline to meet its goal of forcing a congressional vote on a new pact by the end of the year.

After months of making little progress, high-level trade officials from the U.S., Canada and Mexico indicate that negotiations have been gaining momentum, and analysts monitoring the talks the last several days said Friday that there was a fair chance of reaching an agreement in principle in weeks or even days.

The president’s chief trade negotiator, Robert Lighthizer, plans to continue discussions with his Canadian and Mexican counterparts in Washington on May 7. They need to close gaps on sensitive matters including trade in autos and farm goods and rules for handling investment disputes.

Canada and Mexico, rather than make politically unpopular concessions, may decide it better to prolong the talks, even at the risk of a U.S. withdrawal from NAFTA, as Trump has repeatedly threatened.

Moreover, Trump’s practice of lumping different issues together for bargaining leverage has increased uncertainties about the fate of negotiations.

Last month, Trump gave an exemption to Canada and Mexico on hefty steel and aluminum tariffs, but only until May 1, saying what happens afterward would depend on how rewriting NAFTA comes along.

On Monday, Trump suggested that a NAFTA overhaul should include another one of his goals, tighter control of people entering from the southern border.

“Mexico, whose laws on immigration are very tough, must stop people from going through Mexico and into the U.S.,” the president said on Twitter. “We may make this a condition of the new NAFTA agreement.”

The Trump administration has good political reason to wrap up NAFTA talks in the coming days. It wants to lock in a deal ahead of Mexico’s presidential election on July 1, in which a leftist candidate who opposes NAFTA is favored.

Trump and his Republican backers also have their sights on the U.S. midterm election. A successful conclusion to NAFTA talks could give a lift to the GOP and soften an expected loss of seats and possibly control of the House.

For Congress to complete work on a deal this year, Lighthizer would need to reach an agreement in principle very soon. That’s because the parties need time to write a text, give a mandated 90-day notice to Congress and have an economic impact report completed before Congress can vote it up or down.

Trump is betting that his best shot for approval would come during the lame-duck session after the November election, when many lawmakers may be willing to take more difficult votes.

As part of the administration’s legislative strategy, Trump could give the required six months’ notice of withdrawal from NAFTA about the time a text is ready, essentially forcing Congress to accept the new accord or risk the end of the 24-year-old pact, according to trade experts.

“The status quo, which most members of Congress probably prefer, would not be an option,” wrote William Reinsch, a senior advisor at the Center for Strategic and International Studies, although he questioned the wisdom of employing such hardball tactics.

Such a move could inflame opposition. Nor is it clear whether Trump has the legal authority to pull out of NAFTA without congressional support. Many on Capitol Hill and Wall Street fear the potential political and economic fallout of termination.

An end to NAFTA would cause tariffs to rise and create other barriers that would almost certainly hurt trade, production and investments throughout North America.

Settling the NAFTA talks would allow the Trump administration to focus on another, more-fraught trade front with America’s biggest trading partner, China. Trump said Lighthizer would join Treasury Secretary Steven T. Mnuchin in Beijing next week to discuss trade, in what could help lead to a thaw in increasingly tense relations with China.

On NAFTA, the tight political calendar already has spurred Lighthizer to soften his demands to overhaul rules on cars to increase auto and parts production in the United States. The issue has dominated recent negotiations, and a breakthrough could pave the way to settling other sticking points.

Toward that end, Lighthizer dropped his initial push for a new 50% minimum of U.S.-local content before a vehicle can get NAFTA’s tariff-free treatment, and instead is looking at a different formula that could provide more work for American facilities. He has also shown a willingness to bend somewhat on his original proposal to raise the overall North American portion of the value of vehicles to 85% from the current 62.5%, meant largely to reduce reliance of parts from Asia in the assembly of cars and trucks.

But at the same time, Lighthizer has given little indication that he will make a broad retreat on major negotiating objectives, including eliminating or weakening certain NAFTA dispute resolution mechanisms, revising government procurement rules in favor of American firms, and inserting a new, so-called sunset provision that would allow the U.S. to reopen NAFTA after a period of time.

“This is where he sees creating a new American trade agreement model, and so he’s not going to just drop all those rebalancing and restructuring issues,” said Lori Wallach, director of Public Citizen’s Global Trade Watch, which has been a vocal critic of NAFTA. She added that it’s also an opportunity for Lighthizer to get a trade deal that can pass Congress, unlike the Trans-Pacific Partnership that languished without enough support.

Trump has repeatedly blasted NAFTA as a bad deal for America, blaming it for destroying domestic jobs and factories as well as for adding to the large trade deficit with Mexico. But many economists point to factors such as automation for displacing U.S. workers and doubt that a revamped NAFTA would lead to a renaissance in manufacturing resulting in many jobs or much of a reduction in the deficit.

“I am not sure there’s any agreement President Trump can accept politically,” said Michael Camuñez, a former Commerce Department official who is chief executive of Monarch Global Services, a consulting firm with offices in Los Angeles and Washington. “Even if Trump signs off on it — and that’s a big if — Congress is fractured along very delicate lines,” he said.

Congressional Democrats have urged Lighthizer to address Mexican workers’ rights to organize and bargain for higher pay — something that Rep. Sander M. Levin (D-Mich.), a key proponent for tougher labor standards, says will be important if the Trump administration hopes to win Democratic votes for passage of a new NAFTA.

“They have been slowly, incrementally beefing up their proposal,” said Celeste Drake, a trade policy specialist at the AFL-CIO, referring to the Trump trade team’s labor demands. But Drake, one of several hundred business and other stakeholders with whom U.S. trade officials have shared specific negotiating proposals, said she has not yet seen the administration’s consolidated chapter on labor.

On balance, Mexican negotiators would prefer to make a deal and sign a NAFTA agreement before a new government is seated, analysts in Mexico said.

The political calculus includes a desire by the current government to enshrine certain rules on privatizing energy industries through NAFTA before a potentially new president takes office and makes that impossible.

The opposition leftist candidate Andrés Manuel López Obrador has a big lead in the polls and is considered to be more nationalistic and protectionist than the outgoing president, Enrique Peña Nieto.

But Mexican negotiators will be hard-pressed to accept U.S. demands on Mexican wages, as well as restrictive rules on textiles and perishable produce, among other changes. Mexican officials may decide it’s worth the risk to delay and call Trump’s bluff.

don.lee@latimes.com