Roger Stone was the linchpin of a months-long effort by Donald Trump’s 2016 presidential campaign to discover damaging information on Hillary Clinton to be released by the anti-secrecy group WikiLeaks, an effort that began before the hack of Democratic emails was publicly known, Stone’s trial has shown.

Testimony over four days ending Tuesday also revealed engagement by Trump and top aides in making use of Stone’s claims that he knew emails detrimental to Clinton’s campaign would be released.

The trial in federal court in Washington turns on accusations that Stone lied to Congress about his attempts to learn more about what WikiLeaks would publish and when it would do so. But some testimony also raises questions about the president’s written assertions under oath that he did not recall being aware of communications between Stone and WikiLeaks or recall any conversations about WikiLeaks between Stone and members of his campaign.

Rick Gates, who served as Trump’s deputy campaign chairman, testified Tuesday that Stone began discussing Clinton leaks with the campaign in April 2016 and that from May onward Gates understood Stone to be the campaign’s intermediary with WikiLeaks. By July 2016, Gates testified, Trump campaign chairman Paul Manafort said he was updating Trump and others regularly and directed Gates to keep following up with Stone. After Trump ended one phone call from Stone at the end of that month, Gates testified, the future president said to Gates that “more information would be coming.”

The White House declined to comment on Gates’s testimony.

Left open at trial, where Stone is charged with lying to Congress about his own contacts regarding WikiLeaks, is whether Stone ever succeeded in reaching the group. Stone has pleaded not guilty and has said he was fooled by unreliable characters with whom he worked while he also simultaneously exaggerated his WikiLeaks connections to the campaign and in public statements.

Witnesses testified that the Trump campaign was languishing in late summer of 2016 when Stone, who had been fired the previous year from the campaign but remained an informal adviser to his old friend Trump, began promising a way out.

“I have an idea … to save Trump’s a--,” he told Manafort in an email in August. “I know how to win this but it ain’t pretty,” he told campaign chief Stephen K. Bannon in another exchange.

Bannon and Gates both testified that while campaign staffers were skeptical that Stone truly had an inside connection at WikiLeaks, they were hopeful and receptive.

“Roger is an agent provocateur,” Bannon told jurors Friday. “He’s an expert in opposition research, he’s an expert in the tougher side of politics, and when you’re this far behind, you’re going to have to use every tool in the toolbox.”

In a July 22 conversation after WikiLeaks released emails from inside the Democratic National Committee, Gates testified, Stone told Manafort that “additional information would be coming out down the road.” Gates was with Manafort, who had Stone on speakerphone.

“Manafort thought that would be great,” Gates testified.

Gates said Stone also asked for contact information for Trump’s son-in-law Jared Kushner and political director Jim Murphy to brief them on the Democratic emails, which U.S. authorities concluded were hacked by Russia.

After WikiLeaks founder Julian Assange said in July that he had more Clinton emails “pending publication,” Gates said Manafort told him to stay in touch with Stone about future releases. Manafort, Gates testified, “would be updating other people on the campaign, including the candidate.”

Gates testified that he spoke to Stone again in October, after the email account of Clinton campaign chairman John Podesta was hacked and that Stone took credit for predicting that.

Trial testimony about Stone’s conversations with Trump and top aides has filled in several blanks left in the narrative of Russian interference in the 2016 U.S. campaign as told through the final report of special counsel Robert S. Mueller III. The public version of the report contains redactions that prosecutors made to avoid prejudicing jurors against Stone, the last person charged in the probe.

Despite what Gates said was skepticism about Stone’s reliability, he testified that he and other top campaign staffers, including Manafort, spokesman Jason Miller and adviser Stephen Miller, held “brainstorming sessions” based on what Stone told them. When WikiLeaks published unflattering emails from Podesta in October, a staffer for Bannon emailed Stone to say, “Well done.”

Closing arguments are set for 1 p.m. Wednesday. After Gates’s appearance, the government rested its case. Defense attorneys did not call witnesses and rested after playing for the jury about one hour of Stone’s testimony before the House Intelligence Committee

Stone, 67, has pleaded not guilty to lying in that appearance and in his written answers, and to tampering with a witness who might have contradicted his testimony. Stone’s attorneys argued that his testimony was not actually false because he never “successfully” contacted WikiLeaks, and because he believed WikiLeaks was not within the scope of the committee investigation into Russian interference in the election.

Prosecutors counter that they do not need to prove Stone’s intermediaries actually reached WikiLeaks, just that he lied about his communications with them. They said Stone in his own opening statement and answers to the committee acknowledged that the WikiLeaks dissemination of Democratic emails fell squarely within its investigation’s scope.

Stone attorney Bruce Rogow sought to undermine Gates’s credibility by going over in detail the financial crimes to which Gates has pleaded guilty, including tax evasion and embezzlement.

Gates has been a cooperating witness in proceedings that grew out of Mueller’s investigation of Russian interference in the 2016 presidential election campaign. The central finding of Mueller’s investigation is that Moscow had a primary role in sweeping and systemic cyberinterference in the campaign, including stealing and releasing emails from the Democratic National Committee and Podesta.

In a court filing Monday, prosecutors asked that a judge set sentencing for Gates in mid-December, a sign that his cooperation may be drawing to a close after his 2018 plea.

Gates worked with the Trump campaign until Election Day and joined the inaugural committee.

Manafort was sentenced this year to a 7 ½-year prison term on federal convictions in two cases for bank and tax fraud and for illegally lobbying in Ukraine and hiding the proceeds overseas, then encouraging witnesses to lie on his behalf.

The witness Stone is accused of trying to intimidate — radio host and comedian Randy Credico — testified for two days last week about his conversations with Stone regarding WikiLeaks and the pressure to which his old friend subjected him to stonewall the House Intelligence Committee’s Russia inquiry. Stone, Credico testified, made Credico his “patsy” by threatening his reputation and that of a close friend.

Stone, he said, encouraged him to “do a Frank Pentangeli,” referring to a scene in the second “Godfather” movie in which a witness lies to a Senate committee investigating organized crime, denying his prior statements implicating a mafia boss. A transcript of that scene will be given to jurors.

Ultimately, Credico refused to testify before Congress, invoking his Fifth Amendment protections against self-incrimination.

Stone’s lies and Credico’s silence, Taylor testified in the trial before U.S. District Judge Amy Berman Jackson, kept the House committee from being able to contradict Stone’s claim that he had no records of communications with WikiLeaks.