WASHINGTON — Donald Trump’s presidential campaign viewed Roger Stone as an “access point” to WikiLeaks and tried to use him to get advanced word about hacked emails damaging to Hillary Clinton, a former top presidential adviser testified Friday.

In reluctant testimony, former campaign CEO Steve Bannon told a federal court that Stone, on trial for lying to Congress and witness tampering, had boasted about his ties to WikiLeaks and its founder Julian Assange, alerting them to pending new batches of damaging emails.

“The campaign had no official access to WikiLeaks or to Julian Assange,” Bannon told the court. “But Roger would be considered if we needed an access point.”

It was the first time that anyone affiliated with the Trump campaign acknowledged in court that they had actively sought material from WikiLeaks, which released emails that U.S. intelligence agencies determined had been hacked by the Russian government in order to damage Clinton.

The White House had no immediate comment.

Stone, a colorful political operative and Trump ally, is charged with witness tampering and lying to Congress about his attempts to contacts WikiLeaks about the damaging material during the 2016 presidential campaign.

While Stone repeatedly “implied that he had a connection with WikiLeaks,” he never stated it directly, Bannon said.

The campaign took Stone’s boasts seriously enough to follow up, asking why expected information about Clinton wasn’t revealed when Assange held a press conference in October 2016.

Bannon, who testified in response to a subpoena, did not say anything about Trump and said Stone had not been sent by anyone on the campaign to talk to Assange.

Earlier this week, a former FBI agent testified about a flurry of phone calls between Stone and then-candidate Trump — including three calls on July 14, 2016 — the day that a massive hack of the Democratic National Committee’s servers was reported. But the agent said she did not know what was discussed on those calls.

As he left the courthouse, Bannon griped about being subpoenaed by prosecutors and Congress in addition to being interviewed several times by special counsel Robert Mueller’s team as it investigated Russian interference in the 2016 presidential election.

“I was forced and compelled to come here today,” he said as he climbed into a waiting SUV outside the courthouse.

Bannon’s testimony came after comedian and radio talk show Randy Credico told jurors that Stone pressured him into backing up lies he told Congress, threatening to take away his dog at one point. Credico said Stone pressed him to “go along” with a false account of the operative’s contacts with WikiLeaks during the 2016 U.S. presidential campaign.