President Obama, shown here with House Minority Leader Nancy Pelosi (D-Calif.) ahead of a June 12 House defeat of his trade agenda, has rescued the legislation and appears headed for victory this week. (Carolyn Kaster/AP)

President Obama won new powers from Congress on Wednesday to bring home an expansive Pacific Rim free-trade deal that analysts said could boost U.S. economic standing in Asia and ultimately burnish his foreign policy legacy.

Obama’s victory on Capitol Hill, coming 12 days after House Democrats nearly scuttled his bid for “fast-track” trade authority, sets the stage for his administration to complete the multi-nation Trans-Pacific Partnership, or TPP, by year’s end.

It represents a hard-won payoff for a president who was willing to partner with his Republican rivals and defy a majority of his party in pursuit of an accord that aides have said will ensure that the United States maintains an economic edge over a rising China.

“This looks like a big, strategic piece,” said Ian Bremmer, president of the Eurasia Group, a global risk analysis firm. “It’s a global strategy doctrine that will move the world in a direction that, in the long term, is useful for the investments of America.”

The intensive legislative fight — waged for months by a White House eager to score a rare, bipartisan legislative victory late in Obama’s tenure — appeared to be coming to a close after the Senate voted 60-38 to grant final approval to the fast-track bill. Also Wednesday, key House Democrats signaled that they would concede defeat and support related legislation — which they had blocked two weeks ago to stall the trade agenda — that provides retraining assistance for displaced workers.

“Within reach is an opportunity to shape tomorrow’s global economy so that it reflects both our values and our interests,” U.S. Trade Representative Michael Froman said.

The trade-promotion bill now heads to Obama’s desk for his signature. It gives the executive branch additional powers for six years and authorizes the president, and his successor, to present trade deals to Congress for a vote on a specified timeline without lawmakers being able to amend the terms.

Although the outcome is a full-fledged victory for Obama, the acrimony along the way has raised questions about the Democratic Party’s cohesion heading into the 2016 election cycle. Democratic front-runner Hillary Rodham Clinton, who supported the TPP as Obama’s secretary of state, sought to distance herself from the pact more recently.

Most Democrats have dismissed the strategic foreign policy benefits of the trade deal, warning instead that the TPP will cost U.S. workers jobs in traditional manufacturing industries and exacerbate the nation’s widening income gap.

“The foreign policy establishment of the executive branch has divorced itself from the domestic policy,” said Rep. Marcy Kaptur (D-Ohio), who opposed the legislation.

U.S. officials expect the new authority to jump-start the final rounds of talks. Negotiators still must hammer out deals on a number of thorny issues, including new rules on access to Japanese auto and agriculture markets. In addition to lowering tariffs, the trade pact also aims to expand copyright and intellectual property protections and regulate the flow of information on the Internet.

Once negotiations are complete, the administration will have to get a final deal through another vote in Congress, during which labor unions are certain to renew their opposition efforts. The whole process could take six months or more and plunge the Democratic Party into further political turmoil in the middle of a presidential campaign.

The passage of the fast-track bill “does not end our fight for working families,” said House Minority Leader Nancy Pelosi (D-Calif.), who opposed the legislation.

China, which is challenging the U.S. economy as the world’s largest in some measures, is not involved in the TPP negotiations. Obama administration officials have said the trade deal is being structured to allow additional countries to join after the initial deal is ratified. However, the officials said, China has a long way to go before it can meet the labor and environmental standards that will be included in the accord.

Beijing has viewed the TPP skeptically and pursued its own efforts to expand its trade and financial ties in the region, including the new China-backed Asian Infrastructure Investment Bank, which has won support from U.S. allies including Britain and Germany.

That’s why Obama’s push on trade is so vital, foreign policy analysts said. A failure on TPP would lend weight to Chinese claims that the United States does not have staying power in Asia and would leave the Obama administration’s bid to shift diplomatic and military attention toward Asia without its economic centerpiece.

“Confidence [in the United States] was hemorrhaging in Asia,” said Michael Green, who served as senior director of Asia policy at the National Security Council under President George W. Bush. China has ramped up military aggression in a series of maritime disputes with its neighbors, Green said, while the Obama administration has been preoccupied with conflicts in the Middle East and Eastern Europe.

Largely unmoved by the foreign-policy arguments, House Democrats this month voted to block a related Trade Adjustment Assistance bill to provide retraining to workers who are displaced by trade deals.

But Republican leaders quickly resuscitated the trade package by separating the two bills and sending the fast-track bill, which narrowly passed the House, to the Senate as a stand-alone measure for final approval.

White House allies said the trade pact would serve as an unqualified achievement for a president whose foreign policy has been criticized because of the deteriorating security situation in Syria and Iraq and the standoff with Russian President Vladi­mir Putin in eastern Ukraine.

Simon Rosenberg, president of the liberal think tank NDN, included the trade accord among a series of diplomatic efforts by the Obama administration that could help remake U.S. foreign policy. He also cited the administration’s reopening of diplomatic relations with Cuba and the ongoing negotiations aimed at preventing Iran from obtaining nuclear weapons.

“All of a sudden, if you’re a student of history, you’re seeing him use all the tools in the toolbox in a far more traditional manifestation of American power than just bombing people into the Stone Age,” Rosenberg said. “The conventional wisdom in Washington on the way Obama approaches foreign policy is largely wrong and unfair in many ways.”

Paul Kane contributed to this report.