WASHINGTON — President Barack Obama’s quest for “fast-track” negotiating authority on a Pacific Rim trade deal passed its initial tests in the U.S. House of Representatives Thursday ahead of a final vote on Friday on contentious trade measures.

By a vote of 397-32, the House approved a measure authorizing funds to help workers who lose their jobs as a result of trade deals, without cutting Medicare health benefits for the elderly to pay for it, as the Senate had proposed.

The House also voted 217-212 in favor of procedural rules that set up Friday’s votes on the core issue before it: the fast-track bill. Already approved by the Senate, fast-track is needed, Obama says, to help him promptly conclude a 12-nation Trans-Pacific Partnership trade deal.

The House’s struggle to pass the rules indicated that passage of fast-track Friday was not certain.

In an unusual coalition, the Democratic president and House Republican leaders are allied in supporting fast-track. Most Democrats and some Republicans oppose it. The authority would strip Congress of the ability to make changes to a trade deal, but allow it to hold a yes-or-no vote on one.

If fast-track is approved, it would go to Obama’s desk to be signed into law, giving him more sway in negotiating the TPP and reassuring Japan, the second-largest economy involved. Japanese officials have said fast-track approval is needed for the pact, which would encompass 40 percent of the global economy.

Republican House Speaker John Boehner declined to guarantee victory on fast-track.

“We’re working hard to get there,” he told reporters at a press conference.

Boehner said he had labored to address concerns of lawmakers from both parties. He added if the TPP founders, leaving the United States on the trade sidelines, “our allies will gravitate back towards China, away from us and away from our workers.”

In a sign of the importance of the issue to Obama, the White House dispatched Treasury Secretary Jack Lew, Labor Secretary Thomas Perez and White House Chief of Staff Denis McDonough to the Capitol to advocate for fast-track with House Democrats.

After administration officials left a closed-door meeting with House Democrats, Richard Trumka, president of the AFL-CIO labor federation and an opponent of fast-track, then spoke.

Labor organizations oppose fast-track, saying it does not give Congress adequate oversight of trade deals that they fear will result in American job losses.

In the hours leading up to Friday’s House votes, lawmakers also were wary that there might not be enough support for a second vote on the worker adjustment program Republicans have demanded the second vote on aid for workers, known as Trade Adjustment Assistance, so they can register their strong objections to continuing the program, which they see as a waste of money.

“It looks like it’s a head of steam building up against it,” veteran Democratic Rep. Charles Rangel told reporters.

Failure to pass Trade Promotion Authority, also known as fast-track, or worker assistance would seriously hamper Obama’s drive to finish the TPP, a centerpiece of his goal to improve U.S. ties with Asia, this year.

Also on Friday, the House is set to vote on a customs enforcement bill with provisions many Democrats oppose, including weakening a Senate-passed initiative barring countries with severe human trafficking problems from being part of Congress’ fast-track consideration. The measure was aimed largely at Malaysia.

Other Democratic objections center on immigration and climate change provisions that could be blocked by Senate Democrats if the bill enters a negotiation between the two chambers.