The FBI believed then-candidate Donald Trump was closely involved in a scheme to hide hush-money payments to adult film star Stormy Daniels, who claimed an affair with Trump, court documents from the closed campaign finance case against former Trump-fixer Michael Cohen show.

The documents, released Thursday, describe a “series of calls, text messages, and emails” between Cohen, Trump, Trump campaign aide Hope Hicks, Keith Davidson — an attorney for the woman, porn star Stormy Daniels — and David Pecker, an executive of the company that published the National Enquirer.

“I have learned that in the days following the Access Hollywood video, Cohen exchanged a series of calls, text messages and emails with Keith Davidson, who was then Clifford’s attorney, David Pecker and Dylan Howard of American Media, Inc. (“AMI”), the publisher of the National Enquirer, Trump, and Hope Hicks, who was then press secretary for Trump’s presidential campaign,” an FBI agent investigating the matter wrote in the released documents. “Based on the timing of these calls, and the content of the text messages and emails, I believe that at least some of these communications concerned the need to prevent Clifford from going public, particularly in the wake of the Access Hollywood story,” the agent added.

Daniels’ legal name is Stephanie Clifford.

The unsealed documents say that Hicks called Cohen on the night of Oct. 8, 2016 at 7:20 p.m — the first time she had called him in weeks — and that Trump joined the call seconds later. The conversation lasted four minutes. Hicks and Cohen spoke privately after Trump left the call and, after that, Cohen called Pecker. Moments after that conversation ended, Cohen received a phone call from Dylan Howard, the chief content officer of American Media. After that call, Cohen rang Hicks back, ended that call, and then took a call from Pecker. At 8:03 p.m., according to the unsealed court documents, Cohen called Trump. They spoke for eight minutes.

The FBI agent wrote in the document that the information was learned from a review of telephone records and under warrants to obtain Cohen’s emails.

The release of the previously redacted documents comes a day after the federal judge in the case disclosed that prosecutors had concluded their probe into Cohen’s campaign finance crimes and ordered the release of search warrants tied to the case.

Cohen, Trump's former lawyer and fixer, is serving a three-year prison sentence for a slew of crimes, including breaking campaign finance laws by hiding payments to two women who claimed they had affairs with Trump.

"The campaign finance violations discussed in the materials are a matter of national importance," Judge William Pauley III said in court papers, denying the government's request for limited redactions. "Now that the government’s investigation into those violations has concluded, it is time that every American has an opportunity to scrutinize the materials."

Last August, Cohen admitted to making the illegal payments to the two women, identified as Daniels and former Playboy model Karen McDougal, at Trump's behest to silence them ahead of the 2016 election.

Trump has denied the affairs.

The New York probe has long been viewed as potentially perilous for Trump and his associates. The judge's disclosure is the clearest indication yet that federal investigators have concluded their investigation of possible campaign finance crimes involving Cohen and likely any of Trump's other business associates or family members.