President Barack Obama will sign legislation that gives him expanded authority to negotiate trade deals. Pictured: Obama delivers remarks in the White House Rose Garden in Washington, D.C., on June 25, 2015. Reuters/Jonathan Ernst

WASHINGTON -- Congress approved the final piece of legislation to expedite President Barack Obama’s trade agenda, sending the final key bill to the White House for his signature. At times, it appeared Democrats were going to succeed in derailing the president’s trade initiative, but in the end, he was victorious.

The House voted on Thursday overwhelmingly -- 286 to 138 -- with a bipartisan majority to approve Trade Adjustment Assistance, legislation that will create job training programs for anyone who loses their job as the result of a future trade deal. The passage came a day after the Senate voted to approve Trade Promotion Authority, “fast track” legislation that will give Obama increased power to negotiate new trade deals with limited opportunities for Congress to block him. Congress will now conduct a conference on another piece of legislation that deals with currency manipulation.

Obama will sign both pieces of legislation. “With bipartisan majorities, Congress also voted to expand vital support for thousands of American workers each year,” Obama said in a statement after the vote. “As President, I've spent the last six and half years fighting to grow our economy and strengthen our middle class, and that remains my top priority today. I believe we should make sure that the United States, and not countries like China, write the rules of our global economy. We should support more good jobs that pay good wages. We should level the playing field so that our workers have the chance to compete and win. That's what this new legislation will help us do, and I look forward to signing these bipartisan bills into law as soon as they reach my desk.”

Supporters of the legislation praised it as a bipartisan accomplishment. Republican leadership in Congress lauded the ability for them to usher through a comprehensive piece of legislation that the president was willing to sign.

But it faced strong opposition from Democrats, who argued that it would risk American jobs. The real ire is focused on the Trans-Pacific Partnership, which is a deal currently being negotiated with 11 nations that would increase trade between the United States, Australia and several Pacific nations. Democrats argued that the TPP will cost American jobs, do little to address human rights violations and could undermine environmental efforts.

In an effort to derail the entire deal, House Democrats banned together to scuttle the first vote on Trade Adjustment Assistance. Republicans proceeded without the assistance bill and cobbled together enough votes to pass Trade Promotion Authority.

But in Friday’s vote, Democrats dropped their opposition to TAA and voted with Republicans to gain passage. House Minority Leader Nancy Pelosi was the key Democrat to publicly endorse the second vote on TAA and cast her ballot in agreement. She argued that now Democrats can turn their attention to TPP.

Obama can savor the victory of TPA for a few days or weeks. But it won’t be long before Congress is back to fighting about trade when the TPP deal is completed.