WASHINGTON (AP) — Two weeks after his own Democratic Party handed him an embarrassing defeat on trade, President Barack Obama maneuvered his way back to victory, salvaging a key piece of his second-term legacy with the extraordinary help of the very Republican leaders he once accused of obstruction.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 conclude that deal by early fall and that Congress, after a period of public review, 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 declared 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," Senate Majority Leader Mitch McConnell, R-Ky., conceded. "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 comes at a highly sensitive moment in his presidency. Two other legacy-building pieces hang in the balance, with the Supreme Court expected to issue a ruling on his health care law and with a June 30 deadline to conclude an agreement aimed at containing Iran's nuclear program.A setback in either would deny him a major achievement and cut short the White House's delight over winning on trade.But foreign policy experts said Obama's trade agenda would nevertheless stand out as an important milestone in a foreign policy that has been largely marked by overseas crises, 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 — known as the Trans-Pacific Partnership — 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 have argued that 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 maintain that the deal would help big business, cost jobs and not provide adequate standards enforcement.Indeed, the resurrection of Obama's trade package was a stinging defeat for the AFL-CIO and other unions that mounted a vigorous campaign against it and withholding financial support from lawmakers until the vote was completed.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 John Engler, the Republican former governor of Michigan and now head of the Business Roundtable, which helped lead the pro-trade lobbying effort.Two weeks ago, Democrats temporarily scuttled the legislation by tactically defeating a companion measure that would provide assistance to workers displaced by trade, a provision Democrats have typically backed. Headlines heralded a major setback for Obama. But the support for fast-track authority was already evident in a separate vote, and Obama, McConnell and Boehner split up the trade and worker assistance components into separate bills and put them to a vote.By Wednesday, Democrats all but conceded defeat, with many saying they would now support the worker assistance package that will be before them for a vote on Thursday."All trade votes are hard. We always knew it was going to take some twists and turns," said Gabriel Horwitz, an economist and trade advocate at the centrist Democratic think tank Third Way.