Barack Obama smile

The Senate has handed President Barack Obama a major victory by approving “fast track” authority to negotiate trade agreements in Asia and elsewhere.

The 60-to-38 vote on Wednesday clears the way for Obama to seek final language on a trade agreement with Japan and 10 other Pacific-rim nations, known as the Trans-Pacific Partnership. Congress can ratify or reject such agreements but not change them.

It’s a major victory for Obama, who has burnished his legacy on foreign policy just days after the overall trade deal appeared in jeopardy.

The TPP “is by far the most important piece of Obama’s foreign policy legacy,” Ian Bremmer, the president of Eurasia Group, told Business Insider recently.

The Senate granted Obama the same fast-track authority that previous presidents have enjoyed. Thirteen Democrats supported the measure, while five Republicans voted against it.

The GOP-controlled House passed it earlier with help from 28 Democrats. Rep. Paul Ryan (R-Wisconsin), the chairman of the powerful House Ways and Means Committee, celebrated the development minutes after it passed in the Senate.

“Years of hard work have finally paid off. This is a win for our economy, for our national security, for government accountability, and for American leadership,” Ryan said in a statement. “With TPA in place, Congress will have more influence in trade negotiations. And nations around the world will know that America is ready to help write the rules of the global economy.”

The vote was a stinging defeat for environmental groups and for unions that say free-trade agreements kill U.S. jobs. It was also a win for Obama over the liberal wing of the Democratic Party, members of which are opposing the trade agreement.

Obama and Republican leaders say US producers must reach more global markets. Obama has pushed the trade agreement as crucial to increasing US influence in Asia. He has repeatedly warned Congress that China would become more powerful in the region if the US did not complete the agreement.

Political pundits and observers left the measure for dead just days ago, after House Democrats revolted and blocked an attempt to pass a separate measure known as Trade Adjustment Assistance. That measure, which provides federal aid to workers who lose their jobs because of imports, is also awaiting approval.

House Minority Leader Nancy Pelosi (D-California) signaled on Wednesday that she would support TAA when it came up for a vote again.

As reported by Business Insider