The United States and Mexico on Monday resolved a last-minute dispute over labor rights that briefly threatened to derail plans for the House of Representatives to approve a new North American trade deal this week.

Jesus Seade, Mexico’s deputy foreign minister for North America, said he was “very satisfied” with Trump administration assurances about limits on new labor attaches at the U.S. Embassy in Mexico City.

Seade had complained in recent days that the attaches represented a bid to circumvent Mexico’s refusal to permit unilateral American inspections of factories in Mexico. Under the trade deal, only an independent panel chosen by both countries can visit factories to investigate alleged mistreatment of workers.

But after meeting Monday in Washington with Robert E. Lighthizer, the chief U.S. trade negotiator, Seade said the issue had been settled. Lighthizer released a letter to the Mexican official stating that the attaches “will not be ‘labor inspectors’ ” and would not conduct factory inspections.

Asked if Lighthizer’s letter put an end to the brief drama, Seade told reporters: “Absolutely. This is very categorical: These personnel will not be labor inspectors.”

Seade said this weekend that Mexico would refuse to allow the United States to dispatch diplomats to Mexican factories — a demand his government already had rejected during recent bargaining over tweaking the trade deal to win support from House Democrats.

The new U.S.-Mexico-Canada Agreement (USMCA) will replace the 1994 NAFTA accord, which President Trump has called “the worst trade deal ever.” Among its provisions, the USMCA requires automakers to use more North American parts and steel to qualify for duty-free treatment and establishes rules for digital commerce.

The White House on Friday sent Congress legislation to implement the USMCA, and this bill included language establishing the labor attaches. Seade immediately complained that he had not been consulted about the plan.

He flew to Washington for hastily arranged talks with Lighthizer on Monday designed to defuse the squabble.

But with the Mexican Senate already having ratified the three-country accord, Seade had little leverage to demand a change. Several trade analysts, speaking on the condition of anonymity so as not to offend the Mexican official, described the controversy as reflecting domestic politics in both countries.

The labor attaches’ broad mandate to assist Mexican officials and workers on implementation of Mexico’s sweeping labor reforms may have inflamed Mexican business sensitivities about American influence, which Seade felt obliged to counter.

“It looks to me like Seade might have some buyer’s regret and didn’t quite understand how much rope he was giving Lighthizer,” said one former U.S. official, who spoke on the condition of anonymity to preserve his relationship with the Mexican official.

Over the past few days, Seade and other Mexican officials blamed Washington for altering an agreement that had been negotiated over months. As recently as Monday morning, President Andrés Manuel López Obrador expressed his anger at the idea that U.S. inspectors would be allowed in Mexico.

“That was not agreed upon and was done secretly,” he said.

But Mexican critics of the government said the problem was Seade’s lack of preparedness, a claim that Seade on Monday sought to rebut.

Even with the dispute apparently settled, Mexican analysts worried about how the attaches could be used to limit Mexican exports.

“It’s a problem to the extent that the panel system is misused for protectionist reasons, if U.S. producers begin using labor protections to prevent Mexican exports to the U.S.,” said Luis de la Calle, a former Mexican NAFTA negotiator. “The protections are meant to ensure that the benefits of trade are accrued by Mexican workers, not to prevent Mexican exports.”

Lighthizer pointed out in his letter to Seade that the U.S. Embassy in Mexico City already includes attaches from more than one dozen federal agencies, including the departments of Agriculture, Commerce, Defense, Treasury and Justice. Mexico, likewise, stations its own attaches in the United States.

Strong terms for enforcing the pact’s labor rights chapter were essential to win Democratic support for Trump’s rewrite of NAFTA. And House Speaker Nancy Pelosi (D-Calif.) took credit last week for securing changes from the original deal that Trump and the leaders of Mexico and Canada signed last year.

“This is the result of the Democrats taking a victory lap last week,” said Dan Ujczo, a trade attorney with Dickinson Wright. “Mexico made necessary concessions last week, but spiking the football has made these tough to swallow.”

House Democrats do not plan to make any changes to the implementing legislation, which is slated for a House Ways and Means Committee vote on Tuesday and a vote by the full House on Thursday, according to a senior House Democratic official, who spoke on the condition of anonymity ahead of the formal announcement from the United States and Mexico that the issue had been resolved.

“It’s pretty much locked in,” the official said.

The Senate is expected to approve the legislation early next year.

Erica Werner contributed to this report.