Updated

The Clinton campaign’s recent attacks on Donald Trump for his comments about a beauty queen’s weight problems were months in the making, according to an opposition research report uncovered in emails released by WikiLeaks on Sunday.

Democratic presidential nominee Hillary Clinton invoked those comments during the first presidential debate on Sept. 26. Near the end of the showdown, during a sustained riff about the Republican nominee's past remarks about women, Clinton cited the case of Miss Universe 1996 Alicia Machado.

“And one of the worst things he said was about a woman in a beauty contest,” Clinton said. “He loves beauty contests, supporting them and hanging around them. And he called this woman ‘Miss Piggy.’ Then he called her ‘Miss Housekeeping,’ because she was Latina. Donald, she has a name.”

Trump responded: “Where did you find this?”

The answer is: in a 157-page opposition research file that Clinton’s campaign had been using since at least Dec. 19, 2015, the day research director Tony Carrk emailed it – and research files on Sens. Ted Cruz and Marco Rubio – to Clinton Campaign Chairman John Podesta. Podesta’s emails were subsequently hacked and more than 25,000 of them have been released so far by anti-secrecy group WikiLeaks.

TRUMP SLAMS MACHADO: 'I SAVED HER JOB'

In a section on Page 31 titled “Trump Has Devalued And Demeaned Women Repeatedly Throughout His Career,” Trump’s comments to “This Morning” in 1997 are transcribed under the heading “Trump On Miss Universe Pageant Winner.”

“She weighed 118 pounds, or 117 pounds, and she went up to 160 or 170,” Trump said on “This Morning.” “So this is somebody that likes to eat.”

Machado is not identified by her last name, and her first name is misspelled “Alisa.” The supposed “Miss Piggy” and “Miss Housekeeping” put-downs do not appear either. However, Trump’s printed comments on Machado in the document seemingly show the Clinton campaign began considering using the episode against the business mogul before the primaries even began.

While Machado had supported and campaigned with Clinton since June 2016, her name and story didn’t gain national political attention until after the September Hofstra debate – and Trump’s comments and tweets about Machado in the following days, which extended the dispute. Clinton’s campaign was quick to capitalize, coordinating media appearances and using Machado in campaign ads.

Several other avenues of attack outlined in the 2015 Trump report have also appeared during Clinton’s campaign against the GOP nominee. Much of the material was also used by Trump’s Republican primary rivals.

The Clinton campaign Trump file includes headers such as: “Reliance On Chinese Goods”; “Support From White Supremacists”; and “Trump University.” A subsection in a unit on immigration is titled “Conspiracy Theories.” Subsections on Trump’s personal life include notes on “Net Worth,” “Dodging Personal Bankruptcy” and “Comments on Fidelity and Pre-Nuptial Agreements.”

The serious planning to battle Trump as nominee stretches back to at least September 2015 for Team Clinton. In a Sept. 15 email to campaign manager Robby Mook, Podesta advocates dropping Sen. Rand Paul from a nightly analytics report on Clinton's potential adversaries in favor of adding Trump.

In February, former Bill Clinton strategist Joel Johnson wrote to Hillary Clinton communications adviser Jennifer Palmieri asking about the plans to attack Trump.

"Who is in charge of the Trump swift boat project? Needs to be ready, funded and unleashed when we decide," Johnson wrote, referring to the 2004 campaign when the Swift Boat Veterans for Truth unleashed stinging attacks on Vietnam veteran and Democrat nominee Sen. John Kerry.

Meanwhile, other emails in the Podesta trove show Clinton aides’ initial reaction to some of President Obama’s first comments about Clinton using a personal email address for government business, a controversy that has dogged her presidential campaign.

Obama told CBS News on March 7, 2015 that he learned of Clinton’s email practices through news reports at the same time the general public did. Campaign aides quickly circulated a New York Times article featuring the president’s remarks and appeared confused by Obama’s claim. Palmieri emailed senior Clinton adviser Philippe Reines early on March 8 with a suggestion.

“Suggest Philippe talk to [White House press officials]. They know POTUS and HRC emailed,” Palmieri wrote, using acronyms for president of the United States and Hillary Rodham Clinton. “Josh has been asked about that. Standard practice is not to confirm anything about his email, so his answer to press was that he would not comment/confirm. I recollect that Josh was also asked if POTUS ever noticed her personal email account and he said something like POTUS likely had better things to do than focus on his Cabinet’s email addresses.”

The following day, White House Press Secretary Josh Earnest tried to clear up any confusion during his daily press briefing.

“The point that the president was making is not that he didn’t know Secretary Clinton’s email address, he did,” Earnest said. “But he was not aware of the details of how that email address and that server had been set up or how Secretary Clinton and her team were planning to comply with the Federal Records Act.”