Two weeks after his own party dealt him an embarrassing defeat on trade, President Barack Obama maneuvered his way back to victory.
With extraordinary help from the Republican leaders he once accused of obstruction, Obama salvaged a vital piece of his second-term legacy.
Wednesday's 60-38 vote in the Senate to strengthen Obama's trade negotiating position sets the stage for Obama's real prize: conclusion of a 12-nation Pacific Rim trade pact that is crucial to his effort to expand U.S. influence in Asia.
Trade experts believe Obama's negotiators could finish the deal by early fall and that Congress could vote on it by year's end.
To get there, Obama needed legislation giving him authority to negotiate trade deals under fast-track measures that give Congress the right to approve or reject international economic agreements, but not change or delay them. The House passed the legislation last week.
That Republicans agreed to give such authority to a president they believe has already exceeded his powers was as remarkable as Obama's decision to push his trade agenda against all-out opposition from labor and his party's liberal base.
In the process Obama has left erstwhile allies seething.
AFL-CIO President Richard Trumka echoed the sentiment of many Democrats when he said in a letter to lawmakers Wednesday that Obama seemed more intent on getting negotiating authority than in securing tougher trade enforcement and currency provisions and a better assistance package for dislocated workers.
"It hasn't been easy," said Senate Majority Leader Mitch McConnell, R-Ky. "We had plenty of bumps along the road. Frankly, a few big potholes, too. But we worked across the aisle to get through all of them."
Obama's success came at a sensitive moment in his presidency — and one day before the Supreme Court gave him a victory on health care, upholding nationwide subsidies in the law he championed.
Still in the balance is the push to meet a June 30 deadline to conclude an agreement aimed at containing Iran's nuclear program.
Experts said Obama's trade agenda would stand out as a milestone in a foreign policy largely focused on crises abroad, particularly in the Middle East and in Ukraine.
"It's not an exaggeration to say that a successful rebalancing strategy toward Asia would likely rank among President Obama's most significant elements of his legacy," said Matthew Goodman, a former Asia and economic specialist at the White House during Obama's first term.
The trade pact under negotiation links the U.S. with 11 other countries arrayed along the Pacific Rim, including Chile, Mexico, Japan, Vietnam and Australia. The agreement would lower tariffs and other trade barriers while also setting labor and environmental standards for all its participants.
Obama and trade advocates maintained the deal would open up vast new markets to American goods, particularly in Asia where China is negotiating its own regional trade agreement. But Democrats and labor fiercely argued that the deal would help big business, cost jobs and not provide adequate standards enforcement.
The issue created a rare alliance among Obama, McConnell and House Speaker John Boehner, R-Ohio. Also instrumental was House Ways and Means Committee Chairman Paul Ryan, the Wisconsin Republican who was Mitt Romney's running mate in the 2012 presidential contest.
The challenge for Obama was to attract enough Democrats who would break with labor to overcome procedural obstacles in the Senate and make up for Republican opposition in the House. For Republican leaders, the struggle was keeping conservative opposition to Obama at a minimum.
"We had to deal with this notion of aren't we giving up our power under the Constitution?" said Republican John Engler, a former Michigan who now heads the Business Roundtable, which helped lead the pro-trade lobbying effort.
Two weeks ago, House Democrats temporarily scuttled the legislation by defeated a companion measure that would aid workers displaced by trade; that's something Democrats typically have backed.
Headlines called it a major setback for Obama. But the support for fast-track authority was already evident in a separate vote. Obama, McConnell and Boehner agreed to split up the trade and worker assistance components into separate bills and put them to a vote.
By Wednesday, House Democrats all but conceded defeat, with many saying they would now support the worker assistance package set for a vote Thursday.