Trump trial shown expletive-laden texts on Stormy Daniels deal

Watch: The BBC's Nada Tawfik on why Trump was threatened with jail time in hush-money trial

In October 2016, lawyer Keith Davidson was promised "the easiest deal" he had ever done in his life.

On Tuesday, he found himself on the stand in the first criminal trial of a former US president, reading aloud profanity-ridden text messages that led to that deal.

Prosecutors have charged Donald Trump with 34 felony counts of falsifying business records, for allegedly covering up evidence of this hush-money payment to adult film star Stormy Daniels.

Mr Davidson testified about his role in brokering the payout that was intended to keep Ms Daniels, his former client, silent about an alleged sexual encounter with Mr Trump.

Mr Trump has pleaded not guilty to the charges, and denies having sex with Ms Daniels.

His lawyer, Michael Cohen, arranged a $130,000 payout to Ms Daniels on the eve of the 2016 election.

In a dramatic day that also saw Justice Juan Merchan fine Mr Trump $9,000 (£7,100) for multiple violations of his gag order and warn him of potential jail time, prosecutors laid out a paper trail that showed how the payment to Ms Daniels came to fruition.

line
BBC graphic saying 'Trump on trial'
line

Text messages displayed in court on Tuesday showed how behind-the-scenes haggling between Cohen and Mr Davidson over the payout kicked into high gear after the October 2016 release of the Access Hollywood tape.

The infamous 2006 recording captured Mr Trump boasting on a hot mic that he could grab women's genitals without their consent because he was famous.

Prosecutors have argued Mr Trump was desperate to bury Ms Daniel's story in the aftermath of the tape's release, because an additional allegation of a sexual encounter with an adult film star could doom his presidential bid. They have cast the case as one of election interference.

Or, as Mr Davidson put it in a text message to National Enquirer editor Dylan Howard after the tape was released, Ms Daniels "talking…is the final nail in the coffin….but he really is f— already."

"Trump is f—," Mr Howard texted back. "Wave the white flag. It's over people!"

Mr Davidson said that he first met Ms Daniels in 2011, but that he did not start working with her on the hush money payout until the waning days of the 2016 election.

Mr Davidson said he was drawn in by Ms Daniels' manager, Gina Rodriguez, who was already negotiating a deal for that would see AMI, the National Enquirer's publisher, buy the rights to Ms Daniels' story.

The deal with the publisher eventually fell through.

After AMI "washed their hands" of the deal, the publisher handed it off to Cohen, Mr Davidson testified. "In essence,'' he said, Cohen stepped into their shoes.

Ms Rodriguez did not want to deal with Cohen, who Mr Davidson said could be unpleasant to work with. So he assumed the role of Ms Daniels' lead negotiator, after Ms Rodriguez characterized the deal as the 'easiest' ever.

Mr Howard connected the two lawyers via text message.

"Connecting you both in regard to that business opportunity," Mr Howard wrote to Cohen and Mr Davidson. "Spoke to the client this AM and they're confirmed to proceed with the opportunity. Thanks. Dylan."

Prosecutors showed an email from Mr Davidson to Cohen, dated 11 October 2016, confirming that the "settlement sum is $130,000."

Legal documents were attached to the email.

Mr Davidson had trouble actually getting Cohen to send the funds, he testified, and at one point threatened to quit the deal.

Eventually, in late October, Cohen wired the cash.

Earlier in the day, prosecutors showed the record of a wire transfer of $130,000 that Cohen made to an account controlled by Mr Davidson.

Prosecutors claim that Mr Trump broke the law when he later reimbursed Mr Cohen for the hush money payment. They accuse him of falsely recording those reimbursements as legal expenses pursuant to a retainer agreement.

They allege that he did this to influence the outcome of the 2016 election, by hiding damning information from the public.

They aimed to use Mr Davidson's testimony and the flurry of texts sent before the 2016 election to bolster that case.

This was not the only payout Mr Davidson negotiated for a client.

In the summer of 2016, he also brokered a "catch-and-kill" scheme with the National Enquirer for the Playboy model Karen McDougal, who alleged she had an affair with Mr Trump.

Several pages of text messages show exactly how the exclusive rights to Ms McDougal's story was purchased by AMI after Mr Davidson brought them the story.

In June 2016, Mr Davidson texted Mr Howard, "I have a blockbuster Trump story."

His attention piqued, Mr Howard replied: "Talk 1st thing. I will get you more than ANYONE for it. You know why…"

Earlier in the trial, David Pecker, publisher of the National Enquirer, testified that he, Mr Trump, and Cohen reached an agreement to use the tabloid to bolster Mr Trump's presidential campaign.

He said they also agreed to help head off negative stories exactly like those of Ms McDougal and Ms Daniels.

Earlier in the trial, prosecutors had hinted at Tuesday's evidence by revealing an exchange between Mr Davidson and Mr Howard from election night 2016.

Around 3 am on the night Mr Trump shocked the world and won the presidency, Mr Davidson frantically texted his tabloid friend: "What have we done?"