STORY: Hope Hicks, once a top aide to Donald Trump, testified on Friday that he told her in the final days of the 2016 presidential campaign to deny that he had a sexual relationship with porn star Stormy Daniels.

Her testimony gave jurors an inside look at the Trump campaign's damage-control efforts after it was already grappling with the release of an audio clip of the candidate bragging about grabbing women's genitals.

Hicks, who was then the campaign spokesperson, testified that she told Trump four days before the 2016 election that the Wall Street Journal would publish details of Daniels' story.

She told the court quote, "He wanted to make sure that there was a denial of any kind of relationship."

Hicks said Trump did not want his wife Melania to see the story, which also included allegations that he had an affair with former Playboy model Karen McDougal.

Trump has denied having sex with either woman.

These alleged affairs are at the crux of Trump's New York criminal trial, where prosecutors accuse him of illegally covering up a $130,000 hush-money payment made to Daniels to keep quiet about what she says is a 2006 sexual encounter.

Trump is the first former president to face a trial on criminal charges.

And it comes amid his campaign to re-take the White House.

Prosecutors argue that the payment to Daniels corrupted the election by suppressing news that could have influenced voters.

But Hicks' testimony could also bolster Trump's lawyers, who argue the Republican paid off Daniels to keep his wife - not voters - from hearing about the alleged affair.

Trump has pleaded not guilty and called the trial a political move to hurt his candidacy.

And he has chafed against a court-imposed gag order prohibiting him from talking about potential witnesses, the jury, or court staff.

He's already been fined $9,000 for what the judge deemed remarks that violated the order.

Trump said he will sue to lift the gag on his speech.

"We're filing, I think today, a constitutional motion to get this out. We'll be filing a lawsuit on the constitutionality of it. But if somebody says something about me and I'm not allowed to respond, that's never happened before."

The trial resumes Monday.