WASHINGTON – A day after the public heard Donald Trump boasting about grabbing women’s genitals in a leaked "Access Hollywood" outtake, the Republican presidential candidate and some of his top aides began an urgent effort to silence a pornographic actress, according to court records unsealed Thursday.

The documents, part of the FBI's investigation of a hush-money scheme, show agents gathered evidence that Trump participated in an effort to pay off Stormy Daniels, the adult-film actress who claimed to have had an extramarital affair with him years earlier. Authorities laid out a timeline of emails, text messages and phone calls – some involving Trump himself – that "concerned the need to prevent" Daniels from going public with her story.

Trump denied knowledge of the payments after they became public. The FBI told a judge it obtained telephone records showing he participated in some of the first conversations about the scheme, which prosecutors said violated federal campaign finance laws.

Federal prosecutors said in court filings last year that Trump's personal lawyer, Michael Cohen, orchestrated payments to Daniels and another woman, Karen McDougal, "in coordination with and at the direction of" Trump. The documents unsealed Thursday offer an account of the extent of Trump's involvement in that effort, which came at a particularly sensitive moment weeks before the 2016 presidential election.

The Justice Department told a judge Monday that it "effectively concluded" its investigation of the payoffs, signaling the end of one of the criminal inquiries that shadowed Trump's presidency. Federal prosecutors' decision to end the investigation relied at least in part on long-standing Justice Department policy that a sitting president cannot be charged with a crime, a person familiar with the matter said.

More:Prosecutors weighed DOJ policy blocking indictment of a sitting president in closing Trump hush-money probe

More:Justice Department ends inquiry of hush-money payments in final months of Donald Trump's campaign, judge says

Trump's attorney Jay Sekulow said Wednesday that he's pleased the investigation is closed and said Trump "never engaged in any campaign finance violation."

Cohen called Sekulow's comments "completely distorted and dishonest." He said in a statement Thursday that Trump directed him and members of the Trump Organization to "handle the Stormy Daniels matter."

"The conclusion of the investigation exonerating The Trump Organization's role should be of great concern to the American people and investigated by Congress and The Department of Justice," Cohen said.

The White House did not immediately respond to a request for comment.

The documents do not describe the conclusions of the hush-money investigation but offer a window into what FBI agents learned in the first months of their work. They include copies of applications for search warrants laying out evidence that Cohen had broken the law. Cohen pleaded guilty to two felony violations of campaign finance laws and a series of other crimes, for which he is serving a three-year prison sentence.

The timeline of communication began Oct. 8, 2016, the day after The Washington Post published the infamous "Access Hollywood" recording in which Trump talks in vulgar terms about women. Around this time, Daniels planned to talk to "Good Morning America" and Slate about her alleged relationship with Trump in 2006, the same year that his wife, Melania, gave birth to their son.

Hope Hicks, spokeswoman for the Trump campaign, called Cohen the evening of Oct. 8, 2016. Trump joined the call briefly. Hicks, Cohen and Trump continued to talk that night, the documents said. Cohen had also been in communication with David Pecker and Dylan Howard, heads of American Media, which publishes the National Enquirer, about buying rights to the story about the alleged affair to keep it from becoming public, a tactic known as "catch and kill."

More:Court docs show Hope Hicks in contact with Michael Cohen during hush-money discussions

Howard texted Cohen and Keith Davidson, an attorney for Daniels and McDougal, on Oct. 10, 2016, to connect them regarding "that business opportunity." Davidson texted Cohen shortly after, telling him that they needed to "close this deal" that day.

Cohen spent the next few days working to finalize the agreement. On Oct. 17, he began work to create Essential Consultants, a shell company he used to funnel money to Daniels. The negotiation nearly fell apart when Davidson and Daniels threatened to go public with the alleged affair. Cohen called Trump after Davidson threatened to cancel the agreement, the documents say.

Communication picked up again a week later. Howard told Cohen on Oct. 25 that they had "to coordinate something" with Davidson or it "could look awfully bad for everyone." Cohen called Trump twice the following morning. Cohen then worked to finalize the formation of Essential Consultants.

After that, Cohen called Davidson, who sent wiring instructions to him. That night, Cohen confirmed the agreement with the National Enquirer publishers. On Oct. 27, Cohen wired $130,000 from his Essential Consultants account to Davidson.

On Oct. 28, Cohen and Trump talked again for a few minutes. Later that day, Davidson texted him, "all is AOK."

"I hope we are good," Cohen replied.

More:From Trump fixer to Mueller informant: Timeline of Michael Cohen's role in Russia inquiry

"I assure you. We are very good," Davidson said.

That night, Cohen spoke to Hicks.

On Nov. 1, 2016, Davidson transferred money to a bank account in Daniels' name. Cohen made more calls that day to Trump and Kellyanne Conway, Trump's campaign manager, who called him back that night.

On Nov. 4, three days after the transaction with Daniels was completed and four days before the presidential election, The Wall Street Journal broke a story about another alleged affair, between Trump and McDougal, a former Playboy model. The Journal reported that the National Enquirer agreed to pay McDougal to bury her story.

As the Journal prepared to publish the story, Howard attempted to reassure Cohen that there was nothing to worry about. "I think it'll fade into the distance," he told Cohen.

"He's pissed," Cohen responded. Investigators suspected Cohen was referring to Trump.

"I'm pissed! You're pissed. Pecker is pissed. Keith is pissed. Not much we can do," Howard responded, referring to David Pecker and Keith Davidson.

The morning after the Journal's story was published, Cohen assured Hicks that the story was not getting much traction.

"Same, Keep praying!! It's working!" Hicks texted back.

"Even CNN not talking about it," Cohen replied.

On Jan. 12, 2018, about a year into Trump's presidency, The Wall Street Journal broke the story about Cohen's hush-money payments to Daniels.

The hundreds of pages of filings were unsealed after a federal judge in New York announced that investigators concluded their investigation into the hush-money payments. U.S. District Judge William Pauley ordered the government to make public some of the search warrants it used when investigating Cohen, saying the campaign finance violations discussed in the records "are a matter of national importance."

Pauley's order signaled the end of the second in a pair of inquiries in which federal authorities scrutinized the president. The other, the special counsel investigation into Russian election interference, concluded in March without finding that the president committed the crime of obstruction.

The filings reveal that federal investigators assigned to special counsel Robert Mueller targeted Cohen within the first two months of Mueller's appointment in May 2017. Mueller’s team first sought communications related to Cohen, described in court documents as “someone who holds himself out to be the personal attorney for President Trump,” in July 2017 as part of the investigation. Mueller's office handed the case to federal prosecutors in New York.

The filings reveal how deeply the investigators looked into Trump himself. Some of the warrant applications authorities submitted said that among the information they sought was "evidence of communications with Donald Trump."

More:'I am not protecting Mr. Trump anymore.' Michael Cohen ties the president to ongoing criminal inquiries

Sekulow said Wednesday he knew of no other federal investigations in which Trump is a subject.

Prosecutors said Cohen participated in an agreement with a tabloid to “suppress” claims by McDougal to "prevent it from influencing the election.” The agreement involved “Corporation-1,” whose description matches public description of the National Enquirer and which agreed in August 2016 to buy McDougal’s story for $150,000.

The Enquirer's parent company acknowledged in an agreement with prosecutors that it made the payment because McDougal's story could have jeopardized Trump's campaign.

Cohen made the separate payment to Daniels out of his own pocket. Prosecutors said Trump’s business reimbursed Cohen, added $130,000 to pay for Cohen’s taxes and $60,000 as a bonus. Prosecutors said the payments were disguised as legal bills.

Cohen told Congress in February that his former boss masterminded the “cover-up” of the payments to Daniels and directed him to lie about them, including to the first lady.

He presented the House Oversight and Government Reform Committee with a copy of a personal check that he said Trump signed during the first year of his presidency to reimburse him for the payments. Cohen said the check, which was for $35,000, was one of 11 installments.

The newly unsealed documents are the result of an FBI raid in April 2018 of Cohen's home, hotel room, office, safe deposit box, cellphones and electronic communication. Media organizations sought to unseal the search warrants and affidavits related to the raid, but portions about the campaign finance investigation remained redacted until Thursday.