Newly leaked emails show the political calculations that went into Hillary Clinton's decision to back away from supporting the controversial Trans Pacific Partnership (TPP), a trade deal aides privately conceded she would "ultimately" support.

The deliberations were revealed in hacked emails purportedly from Campaign Chairman John Podesta's account that WikiLeaks has published.

In one March 25, 2015, message shortly before Clinton entered the race, senior speechwriter Dan Schwerin sent senior staff, including Podesta and communications director Jennifer Palmieri, a draft letter on trade.

“This draft assumes that she's ultimately going to support both TPA and TPP. It focuses on what needs to happen to produce a positive result with TPP, and casts support for [Trade Promotion Authority] as one of those steps,” he wrote.

At the time of the emails, Congress was preparing for a heated debate on what's known as trade promotion authority (TPA), which would give the White House power to fast-track deals like the TPP. However, Clinton primary foe Bernie Sanders was an ardent opponent of the Pacific nation trade pact, arguing it's bad for workers.

At the time, Clinton found herself in an awkward spot, having been a past supporter, as some union figures spoke out against the deal. In a November 2012 speech in Australia, Clinton infamously proclaimed that TPP “sets the gold standard in trade agreements to open free, transparent, fair trade.” The statement dogged Clinton throughout the primary campaign, and Republican Donald Trump since has repeatedly used it in debates and on the campaign trail.

Clinton would eventually back off her support, saying in an interview with PBS in October 2015, "I am not in favor of what I have learned about it. ... I don’t believe it’s going to meet the high bar I have set." (According to her current website, Clinton would “reject trade agreements, like the TPP, that don’t meet high standards.”)

In an email right before Clinton's reversal, Schwerin acknowledged the difficult line the campaign was trying to walk.

“This is indeed a hard balance to strike, since we don’t want to invite mockery for being too enthusiastically opposed to a deal she once championed, or overclaiming how bad it is, since it’s a very close call on merits,” he wrote on Oct. 6, 2015.

This followed months of internal debate over the problems the TPP issue was causing with unions and voters.

In an April 13 email, pollster John Anzalone advised against “making this decision in a policy vacuum or just because we are concerned about a story of her changing her mind or taking on Obama.”

He went on to note the political peril of “getting on the wrong side of Labor on the only issue they care about has ramifications on the ground” in early primary states.

“I say we suck it up and be as definitive as possible from the beginning that we don’t like these deals. We will be right with voters and right with labor. We get no integrity gold star for staying pure on this issue because of one line if friggin [Hillary Clinton’s book] Hard Choices or because this is a key issue for a lame duck president,” he wrote.

Campaign Manager Robby Mook replied that “the boss won't be comfortable putting her foot down.”

Anzalone continued to press the political danger of angering labor. He said he's concerned the issue is “eating us alive for being on the wrong side and giving Progressives a real reason to try and push someone more weighty into the primary.”

As late as June 2015, Clinton was making the case internally for TPP, circulating a column by former Treasury Secretary Lawrence Summers in The Washington Post arguing that rejecting TPP would damage American leadership.

“Damning w[sic] faint praise but good arguments,” she told senior foreign policy adviser Jake Sullivan. Podesta disagreed, saying the deal ran counter to the concerns of average Americans, while Sullivan stressed the importance to American power. In response, Clinton said Sullivan’s arguments would work with “more sophisticated audiences or interviews.”

The issue of TPP was the primary reason that the AFL-CIO executive committee recommended in July 2015 to delay its endorsement of Clinton until she had moved closer to their position on trade issues.

The Trump campaign seized Thursday on the email revelations, pointing to the March email acknowledging Clinton's continued support as evidence she "lied."

"Today’s email release reveals what we already knew, that Hillary Clinton supports TPP and TPA and she lied about it to the American people at the debate," Trump spokesman Jason Miller said in a statement.