President Obama discusses the opportunities and benefits of trade on March 25 in the Roosevelt Room of the White House. (Susan Walsh/AP)

Galesburg, Ill., was a town on the brink. The local Maytag plant had recently shut its doors, putting hundreds of union employees out of work; frustrated residents despaired that technology and globalization had upended the manufacturing foundations of their community.

Against that backdrop, Illinois’ junior U.S. senator, Barack Obama, delivered a commencement speech at Knox College and directly addressed the seismic changes affecting the economic life of places like Galesburg. He suggested that he understood the problem and that he would pursue policies to provide a solution.

“It’s as if someone changed the rules in the middle of the game and no one bothered to tell these folks,” Obama said. Then he challenged the graduates: “What do we do about this? How does America find its way in the new global economy? What will our place in history be?”

Ten years later, President Obama’s answer to those questions — more trade with Asia — sounds to a lot of people like more of the same, exactly the kind of solution that led to the problems in the first place. As early as this week, Congress is expected to debate “fast-track” legislation that would give the administration more authority to complete a massive, 12-nation free trade pact in the Asia Pacific that Obama has called a cornerstone of his second term — a way to ensure U.S. competitiveness in the face of a rising China.

It will mark a leadership test for the president, who has pledged to invest his waning political capital to woo skeptical Democrats. White House allies said the danger is that Republicans are supporting the president on trade in large part because they know it could divide Democrats going into an election year.

Obama’s embrace of the Trans-Pacific Partnership (TPP) faces fierce opposition from some of his closest political allies and the organizational heart of the Democratic coalition: labor unions, environmental groups and the progressive wing of Congress. His critics on the left contend the pact would help American corporations in state-controlled foreign markets but would lead to job losses and exacerbate the growing income gap at home.

If Obama pushes hard but fails, “Republicans will still be fine with that if they can ignite a civil war on the left,” said Austan Goolsbee, who chaired Obama’s Council of Economic Advisers from 2010 to 2011 and supports the trade push.

Already, the AFL-CIO has suspended all political contributions to focus on defeating the TPP. Rust Belt Democrats have accused Obama of betraying his past opposition to big trade deals as a senator. And Sen. Elizabeth Warren’s fierce criticism of provisions favoring corporations has made it difficult for Hillary Rodham Clinton to embrace the pact in her White House bid — even though she touted it as secretary of state.

“Why, exactly, should the Obama administration spend any political capital . . . over such a deal?” asked the New York Times’ liberal economic columnist Paul Krugman in a blog post.

For Obama, trade offers perhaps the best chance for him to secure a large-scale, bipartisan legislative achievement in his final two years. But aides described his push in more personal terms, suggesting that his beliefs were shaped by his upbringing in Hawaii and Jakarta and his time as a community organizer for displaced workers in Chicago, where he saw the human costs of international competition.

“The president understands that to do trade right we need to put American workers first, and he’s seen that we haven’t always done it right,” said U.S. Trade Representative Michael Froman, Obama’s Harvard Law School classmate. “But he’s also an internationalist who sees that America’s economic interests are intertwined with the rest of the world.”

Wary of choosing a side

That Obama would reach the precipice of a globe-altering trade deal was not always obvious. Twenty-seven days after his commencement address at Knox College in June 2005, Obama cast his first Senate vote on trade legislation offered by President George W. Bush: the six-nation Central American Free Trade Agreement (CAFTA).

He voted no.

CAFTA was eventually signed into law, with the backing of 10 Democratic senators, and Obama appeared conflicted. In an op-ed for the Chicago Tribune, the senator wrote that he had wanted to support the deal because globalization “is a technological revolution that is fundamentally changing the world’s economy, producing winners and losers along the way. The question is not whether we can stop it, but how we respond to it.”

But, he concluded, Bush’s trade pact did not include sufficient labor and environmental standards and failed to offer assistance to retrain workers.

Lori Wallach, director of Public Citizen’s Global Trade Watch, referred to the piece as Obama’s “Hamlet” essay — attempting to argue both sides and signal that he was not a reflexive “no” like many Democratic colleagues.

She and other progressives cite the influence of a number of economic aides in the Bill Clinton administration — Lawrence H. Summers, Robert E. Rubin and Froman — who were among the economists Obama consulted during his campaigns. Clinton won approval in 1993 for the North American Free Trade Agreement (NAFTA), a landmark pact with Mexico and Canada.

Michael Wessel, an aide to former congressman Richard A. Gephardt (D-Mo.), also advised Obama’s 2008 campaign and recalled attending a trade-focused dinner with the senator organized by Froman. Though Obama was well informed, Wessel said, “he didn’t have any really strongly felt views. . . . If you look at the people around Obama, many of whom are Clintonian, this is the continuation of that entire approach.”

For an ambitious Democrat, Obama’s position came with risks — ones that grew more pronounced with the onset of the economic collapse in 2008, in the midst of the presidential campaign. Though economists have debated the effects of NAFTA, unions blame the deal for killing hundreds of thousands of jobs.

Aiming to close the gap with Hillary Clinton in manufacturing-heavy Ohio during the Democratic primary season, Obama pledged to renegotiate that pact, prompting Clinton to also distance herself from her husband’s achievement.

To Obama’s rivals, however, his stance was contradictory. In March 2008, a leaked memo from the Canadian government stated that Goolsbee, a campaign adviser, had told diplomats that Obama’s position on NAFTA was “more reflective of political maneuvering than policy.” The Obama campaign strenuously denied it.

“What Obama managed to do in 2007 and 2008 was sheer political genius: Stake two diametrically opposed positions and persuade each side you are firmly with them,” said Phil Levy, an economist at the Chicago Council who advised Sen. John McCain’s 2008 White House bid. “The problem is that once you get in office and each side says, ‘Okay, go ahead and deliver.’ ”

‘We have to do it differently’

Obama had other priorities in January 2009.

The fight over his economic stimulus package and his health-care law dominated the agenda. In the meantime, Obama put U.S. trade efforts on pause as his first trade representative, former Dallas mayor Ron Kirk (D), conducted a policy review.

Kirk, who had supported NAFTA, was greeted skeptically by Democrats in Washington.

“I remember the president saying, ‘Kirk, I’ve got to tell you that if you lived in some of these states you’d be angry about trade, too,’ ” he recalled in an interview. “He said, ‘We’ve got to get over these false choices that any agreement is good or all trade is bad. We have to do it differently.’”

The United States had initially engaged the Trans-Pacific Partnership talks during the waning years of the George W. Bush administration. Asia’s economy was growing rapidly, China was emerging as an economic powerhouse, and U.S. officials feared the country would fall behind in fast-developing markets.

When Chile, Brunei, New Zealand and Singapore approached the United States to join their small-scale trade talks, the Bush administration agreed, with the caveat that the talks include modern sectors such as telecommunications, insurance services and banking. Sections also were added on intellectual property and resolving disputes between nations and international corporations.

By the time Bush left office, the TPP negotiations had expanded to eight nations. But Bush officials weren’t certain whether Obama would support the project considering the “ugly trade politics of the Democratic primary,” said Susan Schwab, the U.S. trade representative from 2006 to 2009. “The trading partners were very anxious.”

Obama aides were initially doubtful about whether the economic benefits would justify the level of political capital and presidential attention that would be necessary to complete the deal. But the TPP increasingly came to be viewed inside the West Wing as having broader strategic significance as a cornerstone of the administration’s “Asia pivot,” a rebalancing of U.S. foreign policy attention to confront an ascendant China.

The trade deal would offset the Pentagon’s military buildup, White House advisers believed, and reassure the region of the administration’s intentions.

“The argument was: This is an important leadership moment for the United States,” said former national security adviser Thomas E. Donilon, who left in 2013. “If the U.S. pushed hard and indicated its commitment to the trade agreement, it would have a magnetic effect and draw in other countries.”

In December 2009 — a month after Obama’s first visit to Asia, during which he called himself “America’s first Pacific president” — Kirk notified Congress that the administration would engage in the TPP negotiations. To build confidence on Capitol Hill, the administration in 2010 reopened three smaller trade deals — with South Korea, Colombia and Panama — that had been signed by Bush but not yet approved by lawmakers.

After Obama aides negotiated new provisions to each — including worker protections with Colombia and better access to Korea’s automotive market — Congress approved all three deals on the same day in October 2011. The following month, Obama flew to an international economic summit in Hawaii, where he touted the TPP as part of renewed U.S. leadership in Asia and challenged then-Chinese President Hu Jintao to start “playing by the rules” of the emerging regional order.

Over the next two years, Mexico, Canada and Japan entered the talks, making good, administration officials said, on Obama’s campaign pledge to renegotiate NAFTA. The 12-nation pact now covers countries that represent 40 percent of the world’s gross domestic product, though China remains on the outside.

Tough sell in Congress

Doubts remain on Capitol Hill and in Asia about whether Obama can close the deal.

The president has dispatched his Cabinet to lobby Congress, emphasizing his commitment to enforceable labor and environmental protections. But Democrats have been cool to the sales pitch, and Obama has had to personally call lawmakers.

In the meantime, Asian countries are growing impatient and U.S. allies in Europe, including Britain and Germany, agreed recently to support a new China-led Asian development bank over the objections of the Obama administration. Japanese Prime Minister Shinzo Abe is expected to appeal to U.S. lawmakers in an address to a joint session of Congress when he comes to Washington in two weeks for a state visit.

Obama acknowledged the uphill political fight he faces during a recent meeting to promote his agenda with small-business executives.

“Trade deals have not always been good for American manufacturing,” he said. “There have been times where because the trade deal was one way, American workers didn’t benefit and somebody else did. Well, we intend to change that.”

In many respects, however, Obama faces the same type of deep skepticism he did in Galesburg a decade ago among those he has tried the hardest to convince. On a trip to Cleveland last month, Sen. Sherrod Brown (D-Ohio) accompanied the president on Air Force One.

The trade deal “comes across badly,” Brown said. Obama is “talking about it as part of national security, not part of his economic message, because it doesn’t work.”

Juliet Eilperin contributed to this report.