(CNN) Candidate Donald Trump expected leaks during the 2016 campaign that could hurt Hillary Clinton -- and his campaign openly welcomed them, a former top campaign aide testified in court Tuesday.

The revelations, which emerged in the criminal trial of onetime Trump adviser Roger Stone, were included in former special counsel Robert Mueller's report but were kept secret until now because of the pending trial.

The testimony Tuesday from former aide Rick Gates puts in even sharper relief how much Trump himself knew about how the Russian hack and release of Democratic emails could help his campaign.

Former deputy campaign chairman Rick Gates testified that he was riding in a Chevy Suburban from Trump Tower to LaGuardia Airport in New York in mid-2016 when Trump took a late-evening phone call from his longtime associate Stone. The pair apparently discussed WikiLeaks' planned release of hacked Democratic emails.

"After Mr. Trump got off the phone with Mr. Stone, what did Mr. Trump say?" prosecutor Aaron Zelinsky asked Gates. "He indicated more information would be coming," Gates responded in testimony at Stone's criminal trial in Washington.

The call happened days after WikiLeaks' first release on July 22, 2016, of emails the Russian military hacked from the Democratic National Committee. Gates said two US Secret Service agents also witnessed the call.

Stone is on trial for charges that include lying to Congress, witness tampering and obstructing Congress in a case that stems from the special counsel investigation into Russian interference in the 2016 election. Stone has pleaded not guilty to all charges.

Testimony differs from Trump's previous denials

Gates' testimony flies in the face of repeated denials by both Stone and Trump that they had ever discussed WikiLeaks or Stone's supposed backchannel to the organization.

Stone had been asked by House investigators: "Did you discuss your conversations with the intermediary with anyone involved in the Trump campaign?"

"I did not," he replied. He also denied discussing with Trump WikiLeaks' releases or the hack of the Democrats.

Trump, in written answers provided to the special counsel investigators, wrote: "I do not recall being told during the campaign that Roger Stone or anyone associated with my campaign had discussions with any of the entities named in the question regarding the content or timing of release of hacked emails."

Trump also wrote he recalled no specifics of conversations he had with Stone between June 2016 and Election Day: "I do not recall discussing WikiLeaks with him, nor do I recall being aware of Mr. Stone having discussed WikiLeaks with individuals associated with my campaign, although I was aware that WikiLeaks was the subject of media reporting and campaign-related discussion at the time."

In the final stretch of the 2016 presidential campaign, Trump made near-daily references to WikiLeaks at his rallies, sometimes reading directly from the messages and latching onto theories that were being simultaneously promoted by Kremlin-controlled news outlets.

The revelation at the trial on Tuesday is among the details that have been withheld from the public in Mueller's final report on Russian interference in the 2016 election, which concluded that campaign officials hadn't engaged in a criminal conspiracy with the Russians but had welcomed the leaks. When the report was released in May, the Justice Department redacted key portions about Trump's reaction to the WikiLeaks releases because the information was related to Stone's trial. This was a necessary move given a gag order on Stone's case, but it blunted the impact of some damaging allegations against Trump and how his campaign knowingly benefitted from Russian meddling.

Gates, in sharing what he knew of Stone and Trump's conversations, became one of the most significant witnesses of the Mueller investigation and has continued to be a key witness in cases prosecutors have pursued. Tuesday marked the third time Gates has testified at a criminal trial, but the first time he is speaking to a jury about interactions with Trump. He is likely to be sentenced for crimes unrelated to his time on the campaign next month.

Trump campaign saw leaks as a 'gift'

Stone's court proceedings, in the fourth and final day of witness testimony, focused on the Trump campaign's interactions with Stone and the impression he gave them that he knew what leaks were coming.

Stone began giving top Trump campaign official Paul Manafort the impression as early as April 2016 that leaks were coming that could help Trump. A month earlier and that month, the Russians had hacked emails of Clinton campaign employees, including the campaign chairman, and into the networks of the Democratic Congressional Campaign Committee and the Democratic National Committee. That same month, the hackers "began to plan the release" of the stolen information, prosecutors wrote in a separate indictment of alleged the Russian government hackers.

Also that month, Stone's frequency of communications with Manafort spiked, prosecutors said last week.

Gates said the announcement in June 2016, that WikiLeaks had pending information on then-presidential candidate Clinton was a "gift."

"It was in a way a gift that we had not sought," said Gates.

"There were a number of us who felt it would give our campaign a leg up," he added.

Gates said he participated in "brainstorming sessions" with Manafort as well as fellow advisers Jason Miller and Stephen Miller based in part on what Stone was telling them would be coming.

He added that the campaign was in "disbelief" that the information would be coming out because up until WikiLeaks began releasing emails in July 2016, Stone's promises hadn't come true.

On June 15, 2016, the Democratic National Committee announced the committee had been hacked, with the first WikiLeaks release of emails landing a week later. The development became a major opportunity for the Trump campaign and for Stone.

"For months, information had been talked about" in the campaign prior to the July 22 drop of emails, Gates testified Tuesday. "The campaign was in a state of happiness" in the wake of the July release. "This was information that had come out on our competitor. It had come out through channels unrelated to us."

Stone even asked for Trump's son-in-law Jared Kushner's contact info, Gates testified.

Still few answers about what Stone knew

Both the prosecutors and Stone's defense lawyers finished presenting evidence to the jury on Tuesday, without explaining exactly what Stone knew about WikiLeaks' release or the hacked Democratic documents.

Prosecutors haven't filled in details on whether Stone got confidential information from WikiLeaks through a supposed backchannel, as he had boasted. Stone is accused of lying to Congress about what he discussed with the campaign regarding WikiLeaks and about the supposed backchannel. He is also charged with threatening his associate Randy Credico to lie to Congress about Stone's supposed backchannel.

For his defense, Stone's legal team played about an hour of audio tape from his House Intelligence Committee testimony in September 2017, during which he allegedly lied, giving no further comment. Stone's defense attorneys called no witnesses -- including Stone, who could have testified in his own defense. But instead, the strategy appeared to be to allow Stone to speak for himself, on tape, with no chance he could go off script.

After the jury left for the day Tuesday, Stone told the judge it was his decision not to testify in his case.

The tape included questioning from members of Congress, including Reps. Adam Schiff, Eric Swalwell and Trey Gowdy, and covered questioning of Stone about Russian collusion, former FBI Director James Comey's firing and Stone's potential contact with WikiLeaks founder Julian Assange.

As the long audio tape played in the courtroom, some jurors appeared to gaze off, yawning and glancing around the room.

But a few of Stone's statements on the recording elicited laughs. When asked about a long phone conversation he had with Trump, Stone said he spoke to the then-candidate for about an hour on the phone. "That means he (Trump) talks for 50 minutes," Stone said.

The jury will return Wednesday afternoon to hear closing arguments from both sides.

This story has been updated with additional developments Tuesday.