Hillary Clinton's presidential campaign and the Democratic National Committee helped pay for political research into Donald Trump that ultimately produced a dossier of allegations about his ties to Russia, The Associated Press has learned.

Trump has called the material "phony stuff," and on Wednesday he portrayed himself as the aggrieved party, calling it a "disgrace."

Trump made the comments speaking with reporters on the South Lawn before departing for Texas.

"Hillary Clinton always denied it. The Democrats always denied it and now, only because it is going to come out in a court case, they said, yes, they did it, they admitted it, and they are embarrassed by it. I think it is a disgrace, it just really, it is a very sad commentary on politics in this country," Trump said.

The president posted a quote on Twitter that he attributed to Fox News:

"Clinton campaign & DNC paid for research that led to the anti-Trump Fake News Dossier. The victim here is the President." @FoxNews — Donald J. Trump (@realDonaldTrump) October 25, 2017

The FBI has worked to corroborate the document, and special counsel Robert Mueller's team, which is investigating potential coordination between Russia and the Trump campaign, questioned Christopher Steele, the former British spy who helped compile the claims in the dossier, weeks ago.

The dossier circulated in Washington last year and was turned over to the FBI for its review. It contends that Russia was engaged in a long-standing effort to aid Trump and had amassed compromising information about the Republican. Trump has repeatedly dismissed the document as false and in recent days has questioned whether Democrats or the FBI had helped fund it.

Trump also has challenged the findings of the FBI, NSA and CIA that Russia waged a large-scale influence campaign to interfere in the election. The FBI and the CIA have said with high confidence that the effort was aimed at hurting Clinton's candidacy and helping Trump. The NSA found the same with "moderate" confidence.

A person familiar with the matter, who spoke on condition of anonymity to discuss confidential client matters, said the funding arrangement was brokered by Marc Elias, a lawyer for the Clinton campaign and the DNC, and his law firm of Perkins Coie.

The deal began in the spring of 2016, when the firm was approached by Fusion GPS, the political research firm behind the dossier, and lasted until right before Election Day, according to the person. When Fusion approached Elias, it had already been doing research work on Trump for a client during the GOP primary. The identity of the original client has not been revealed.

It's unclear what Fusion GPS had dug up by the time law firm hired it in April 2016. According to a copy of the dossier published by BuzzFeed last year, the earliest report from Steele dates to June 2016. It was not immediately known how much money Fusion was paid or how many others in the Clinton campaign or DNC were aware that the firm had been retained.

Elias did not immediately return an email seeking comment, and representatives of Fusion GPS declined to comment. The Washington Post first reported the arrangement.

Clinton campaign officials did not immediately comment, but in a statement, a DNC spokeswoman said the party chairman, Tom Perez, was not part of the decision-making and was unaware that Perkins Coie was working with Fusion GPS.

"But let's be clear, there is a serious federal investigation into the Trump campaign's ties to Russia, and the American public deserves to know what happened," the statement said.

Former Clinton campaign spokesman Brian Fallon said on Twitter that he regretted not knowing about Steele's hiring before the election, and that had he known, "I would have volunteered to go to Europe and try to help him."

"I have no idea what Fusion or Steele were paid but if even a shred of that dossier ends up helping Mueller, it will prove money well spent," he wrote in another tweet.

According to a letter obtained by the AP on Tuesday night, representatives of Fusion GPS reached out in early March 2016 to express interest in continuing research on Trump it had begun "for one or more other clients during the Republican primary contest."

At that time, the Clinton campaign was looking toward the general election and was pivoting attention toward Trump, who was emerging as the GOP front-runner.

Perkins Coie engaged Fusion GPS in April 2016 "to perform a variety of research services during the 2016 election cycle," according to the letter.

The dossier created a political firestorm in January when it was revealed that then-FBI Director James Comey had alerted Trump to the existence of allegations about him and Russia. Since then, Trump has repeatedly attacked it and Republicans in Congress have worked to discredit it, even issuing a subpoena to force the disclosure of Fusion GPS's bank records.

The letter, sent Tuesday by the law firm's general counsel to a lawyer for Fusion GPS, was intended to release the research firm from its obligation to keep confidential the identity of its client.