WASHINGTON (CN) — Rick Gates, the former Trump deputy campaign manager turned star witness for the Justice Department, testified in D.C. federal court Tuesday that Roger Stone informed then-candidate Donald Trump in July 2016 that WikiLeaks would publicly release Russian-hacked documents in the months leading up to the election.

The testimony appears to narrowly contradict a statement Trump made to former special counsel Robert Mueller about the president’s knowledge of WikiLeaks’ role in the election that U.S. intelligence officials have since confirmed was corrupted by Russian interference.

In an unusual move that allowed the jury to hear from Stone without subjecting the defendant to cross-examination by federal prosecutors, after Gates’ testimony the defense played over 50 minutes of audio recording from Stone’s testimony to Congress two years ago.

The provocative former Trump adviser has pleaded not guilty to lying to the House Intelligence Committee about ties to WikiLeaks, along with charges of obstruction of justice and witness tampering.

The Justice Department told the jury at the opening of the trial, now in its second week, that Stone lied to Congress because “the truth looked bad for Donald Trump.”

With Stone seated at the defense table, the jury heard his voice resounding in the courtroom as he firmly denied on Sep. 26, 2017 that he ever discussed WikiLeaks with Trump.

But Gates just hours prior, seated at the witness stand, told a different account of Stone relentlessly pushing WikiLeaks information up the chain of command to Trump in the summer months before Americans went to the polls.

Under a plea agreement, Gates peeled back redactions on a section of Mueller’s report that lays out a call the witness overheard riding with Trump in a Suburban driven by Secret Service agents en route to LaGuardia Airport. The call unfolded after the initial dump of hacked documents by WikiLeaks on July 22, 2016.

“I saw [Stone’s] cell phone number on the caller I.D.,” Gates said, referring to the candidate’s phone. Gates testified that he heard the defendant’s voice on the other end of the call.

“Immediately after the phone call with Mr. Stone ended, what did Mr. Trump say to you?” Justice Department attorney Aaron Zelinsky asked.

Stone’s attorney objected to the question. But after a lengthy discussion at the bench, U.S. District Judge Amy Berman Jackson allowed the federal prosecutor to proceed with the line of questioning.

“[Trump] indicated that more information would be coming,” Gates testified.

Asked in 2018 by Mueller’s team if he recalled being told of any campaign official including Stone “having any discussions, directly or indirectly, with WikiLeaks,” Trump said: “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.”

The president’s statement in the form of written answers to questions submitted by the special counsel’s office to the White House — after Trump refused to be interviewed — was shaken by Gates’ testimony.

The witness testified that he always believed that Stone had a direct line of communication with the organization headed by Julian Assange.

Gates did fall short of connecting his personal knowledge to Trump’s understanding on the campaign trail of Stone’s ties to WikiLeaks, an organization considered by Congress to have served as a “third-party intermediary for Russian intelligence.”

But a line of questioning under cross-examination left open that Trump may have lied to Mueller about conversations regarding WikiLeaks during the campaign, including on the call with Stone en route to LaGuardia.

“You heard [Stone’s] voice?” defense attorney Bruce Rogow asked Gates.

“Correct,” the witness said.

“But you could not hear the content of the call?” Rogow asked.

“That is correct,” Gates replied.

With a guilty plea to conspiracy and lying to the FBI, Gates faces up to 10 years in prison. His appearance on Tuesday marked Gates’ third testimony as a cooperating witness, having taken the stand in the government’s case against former White House counsel Greg Craig and against his former boss on the Trump campaign, Paul Manafort.

Testifying in a dark suit and powder blue tie, Gates said Stone never revealed his source to WikiLeaks in the months that the longtime Trump adviser was calling up top campaign officials to tell them Assange had damaging information on Trump’s opponent, Hillary Clinton.

“But given that the information was coming from WikiLeaks I assumed it was WikiLeaks,” Gates said, adding that Stone had provided “information in advance” of public announcements by Assange.

Trump also told Mueller’s team in a written statement that prior to media reports, he had “no recollection of being told that WikiLeaks possessed or might possess emails related to John Podesta,” who chaired Clinton’s 2016 campaign.

Trump followed up stating he had “no recollection of being told that Roger Stone, anyone acting as an intermediary for Roger Stone, or anyone associated with my campaign had communicated with WikiLeaks on October 7, 2016.” The answer honed in on the special counsel’s more open-ended question, asking if Trump was aware of any such communications “on or about” Oct. 7, 2016.

Asked about WikiLeaks’ second release, Gates said the campaign learned “via the public media” that emails hacked by Russian intelligence from an account belonging to Podesta were now public.

He gave no indication of whether the candidate had prior knowledge of the content of the second dump, knowledge Trump would later deny to Mueller.

Stone never informed Gates, the witness said, of specifics on the information that the Trump campaign was eagerly expecting after the first release in July. The second release in October 2016 set off happiness and disbelief among top campaign officials, Gates said. “It was in a way a gift that we had not sought that was coming out.”

The reports Stone was widely sharing with key actors in Trump’s push to the White House were not public information, Gates testified. Emails between Gates and Stone submitted as evidence show the defendant prior to the initial WikiLeaks’ dump was pushing Gates to hand over contact information for Jared Kushner, Trump’s son-in-law.

After initially testifying that the campaign did not act on Stone’s reports before the first document release in July, Gates amended the statement from the stand. Brainstorming sessions unfolded with Gates, Manafort and other top campaign officials on how to respond to leaked information on Clinton.

“For months it had been talked about, rumored, that information would be coming out,” Gates said, later confirming that it was Stone who propagated the rumors.

Manafort, now in prison for a litany of financial crimes, was still uncertain about future releases by WikiLeaks after the initial July 2016 dump, Gates testified. But the Trump campaign manager possessed enough information to take Stone’s reports to the top.

“[Manafort] indicated that he was going to be updating other people on the campaign including the candidate,” Gates testified.

Just hours later the jury heard Stone repeatedly deny in testimony to the House Intelligence Committee that he had any record of communications with Manafort or other Trump campaign officials relating to the congressional investigation into Russian interference.

Democrat Adam Schiff, then the House Intelligence Committee ranking member, asked Stone to confirm under oath that he possessed no records — “no documents, no emails, no texts, no tweets” — relating to the allegation of hacked documents.

“In connection with Russian collusion, consistent with your exact and precise request, yes,” Stone said.

House Democrats skeptical of Stone’s testimony in 2017 had asked during the closed-door questioning if it was merely a coincidence that Stone’s frequent predictions in 2016 that WikiLeaks possessed documents damaging to the Clinton campaign turned out to be true.

“Yes indeed it is exactly that — a coincidence,” Stone told Congress in 2017, adding: “I am no dupe for the Russians.”

The committee specifically asked Stone if he ever discussed Russian involvement with Manafort. Stone said he had not, “other than to be dismissive” about reports Russia was colluding with the Trump campaign to sway the election.

No witnesses were called in the defense’s case for Stone’s innocence — it began and ended with the audio recording from his congressional testimony.

Stone’s attorneys have continued to sketch out in court the delineation he drew between Russia and WikiLeaks in 2017.

But taking up the defense motion for acquittal, Judge Jackson told both parties with the jury outside the courtroom that Stone knew full well when he testified to Congress that the House investigation on Russia would “naturally tend to touch on the documents that were ultimately published by WikiLeaks.”

“He walks in and says this is the subject matter of my testimony today,” the judge said, referring to Stone’s opening statement to Congress in 2017.

Stone had testified that radio show host Randy Credico served as his go-between to Assange. But federal prosecutors submitted as evidence emails showing that Stone dispatched Obama-birther conspiracy theorist Jerome Corsi to London to make contact with Assange.

While Stone’s legal team is banking on the claim that Credico “played” Stone, leading the defendant to believe that Credico had ties to WikiLeaks, Jackson dismissed the idea almost entirely.

“I just don’t understand where there is any count that actually turns on. . .proof of an actual intermediary,” Jackson said. The judge reserved a ruling on the motion for acquittal.

The Justice Department and defense will give closing statements to the jury on Wednesday afternoon. A verdict on Stone’s fate is expected before the end of the week.